美文网首页
centOS下mysql更改密码以及设置远程连接

centOS下mysql更改密码以及设置远程连接

作者: 篝火叶明 | 来源:发表于2018-07-27 10:53 被阅读5次

一、更改root 用户密码

mysql -u root -p

use mysql

UPDATE user SET Password = PASSWORD('newpassword') WHERE user = 'root';

FLUSH PRIVILEGES;

二、设置远程连接

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

FLUSH PRIVILEGES;

iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

相关文章

网友评论

      本文标题:centOS下mysql更改密码以及设置远程连接

      本文链接:https://www.haomeiwen.com/subject/anywmftx.html