linux安装mysql命令
linux上安装mysql:5.7.28(虚拟机centox7)
解压文件:tar -xvf mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
通过mariadb筛选检查rpm文件:rpm -qa|grep mariadb
移除文件(追加级表化的移除):rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
安装rpm文件
1.安装common:rpm -ivh mysql-community-common-5.7.28-1.el7.x86_64.rpm
2.安装libs:rpm -ivh mysql-community-libs-5.7.28-1.el7.x86_64.rpm
3.安装libs-compat:rpm -ivh mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
4.安装客户端client:rpm -ivh mysql-community-client-5.7.28-1.el7.x86_64.rpm
5.安装服务端server:rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm
6:安装开发工具devel:rpm -ivh mysql-community-devel-5.7.28-1.el7.x86_64.rpm
注:server可能安装不了,
需要安装:yum search perl
yum -y install perl.x86_64
yum search libaio
yum -y install libaio.x86_64
yum search net-tools
yum -y install net-tools.x86_64
初始化mysql:mysqld --initialize --user=mysql
查看初始密码:cat /var/log/mysqld.log cat /var/log/mysqld.log
系统启动是启动服务:systemctl start mysqld.service
查看是否启动成功:systemctl status mysqld.service
修改密码:set password=password('root')
关闭防火墙:
1.关闭iptable:systemctl stop iptable
2.关闭防火墙:systemctl stop firewalld
3.系统启动是关闭:systemctl disable firewalld.service