yum安装mysql

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 下载安装包

yum -y install mysql57-community-release-el7-10.noarch.rpm yum安装rpm安装包

yum -y install mysql-community-server 开始安装MYSQL的服务器

systemctl start mysqld.service 开启mysql服务

grep "password" /var/log/mysqld.log 找出默认密码 QEUmMnf3dO#3

mysql -u root -p 登录mysql

set global validate_password_policy=0; 修改全局参数(安全级别)

set global validate_password_mixed_case_count=0; 字母大小写的个数

set global validate_password_number_count=3;数字个数

set global validate_password_special_char_count=0;特殊字符数

set global validate_password_length=4; 修改密码长度为4

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘root‘; 修改密

use mysql;切换到mysql数据库

update user set host = ‘%‘ where user = ‘root‘; 打开mysql远程连接的开

FLUSH PRIVILEGES; 刷新权限表

相关推荐