首页 > 技术文章 > Centos7.3 mysql5.7 密码修改及远程登陆配置

xinyibufang 2018-05-11 19:44 原文

修改密码命令

set password for root@localhost = password('admin@123');

连接命令

ln -s /usr/local/mysql/bin/mysql /usr/bin

允许远程连接mysql配置

update user set host='%' where user='root';

如果出现错误:ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

则输入 SET SQL_SAFE_UPDATES = 0; 然后再次update

最后别忘了

flush privileges;

 

推荐阅读