rpm -qa | grep mysql
有东西就rpm -e +文件名
下载
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 -y install mysql-community-server
如果出现Error: GPG check FAILED就强制安装
yum install -y mysql-community-server --nogpgcheck
安装完成
启动
systemctl start mysqld.service
查看状态
service mysqld status
查看初始密码
grep 'password' /var/log/mysqld.log
登录mysql
mysql -uroot -p:O8/8Emal/wE
修改密码
alter user user() identified by "123456";
出现
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
修改密码规则
set global validate_password_length=1;
set global validate_password_mixed_case_count=0;
set global validate_password_policy=0;
最后再修改密码就完成了
设置远程访问权限
GRANT ALL PRIVILEGES ON 表.* TO '用户名'@'%或者ip' IDENTIFIED BY '远程访问使用的密码' WITH GRANT OPTION;
刷新权限
flush privileges;