1 下载:
[root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2 安装:
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~]# yum -y install mysql-community-server
3 启动:
[root@localhost ~]# systemctl start mysqld.service
查看状态:
[root@localhost ~]# systemctl status mysqld.service
4 修改密码:
[root@localhost ~]# grep "password" /var/log/mysqld.log
[root@localhost ~]# mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
注意:这里如果要使用简单密码,需先输入下面两句命令,再修改密码才可以:
mysql> set global validate_password_policy=0; mysql> set global validate_password_length=1;
由于安装yum repository,导致操作yum会自动更新,需执行下面命令:
[root@localhost ~]# yum -y remove mysql57-community-release-el7-10.noarch
内容转载至https://www.cnblogs.com/luohanguo/p/9045391.html