cetnos7安装mysql5.7

1.wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
#下载mysql的安装引导
2.yum -y install mysql57-community-release-el7-10.noarch.rpm
#安装mysql安装引导
3.yum -y install mysql-community-server #安装mysql服务
4.systemctl start  mysqld.service #启动mysql服务
5.systemctl status mysqld.service #检查mysql的状态
6.grep "password" /var/log/mysqld.log #获取mysql原始密码
7.mysql -uroot -p  #使用或得到的初始密码进入mysql
8.ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';  #修改用户密码
9.grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option; 
#允许用户远程访问  %表示所有的主机都可以使用此账户登录,可以设定指定的ip地址
10.flush privileges; #刷新权限
上一篇:Linux安装 Java + MySQL + Redis


下一篇:虚拟机环境安装MySQL