centOS下mysql更改密码以及设置远程连接
2018-07-27 本文已影响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