wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 下载安装使用的yum
yum -y install mysql57-community-release-el7-10.noarch.rpm 下载MySQL
yum -y install mysql-community-server 安装MySQL
systemctl start mysqld.service 启动MySQL
systemctl status mysqld.service 查看MySQL启动状态
grep "password"/var/log/mysqld.log 查看默认密码
mysql -uroot -p 进入数据库
set global validate_password_policy=0; 修改密码校验
set global validate_password_length=1; 修改密码校验
alter user 'root'@'localhost' identified by '123456'; 修改密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码'; 开启远程访问权限
exit 退出数据库
yum -y remove mysql57-community-release-el7-10.noarch 卸载掉安装MySQL使用的yum软件,否则每次yum操作都会自动更新