1.下载
去官网下载Yum源:地址
2.安装
rpm -ivh mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server
service mysqld start
3.连接设置
初始安装没有密码
mysql -u root
如果报以下错误
运行如下命令查看密码
cat /var/log/mysqld.log |grep password
再次登录并输入密码即可
设置密码
set password for 'root'@'localhost' = password('password');
如果报以下错误
退出mysql连接运行如下命令
mysql_upgrade -uroot -p
再次更新密码提示成功
如果报以下错误
修改密码强度插件
mysql> set global validate_password_policy=0;
mysql> set global validate_password_mixed_case_count=0;
mysql> set global validate_password_number_count=3;
mysql> set global validate_password_special_char_count=0;
mysql> set global validate_password_length=3;
mysql> set password for 'root'@'localhost' =password('password');
设置远程连接
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;