mysql修改密码及开启远程访问

180it 2020-06-01 PM 118℃ 0条

修改root用户密码:

mysql>update user set password=PASSWORD('新密码') where user='root';

mysql>flush privileges;
开启远程访问:

mysql -u root -p

mysql>use mysql;

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

mysql>select host, user from user;

mysql>GRANT ALL PRIVILEGES ON . TO 'root'@'%'WITH GRANT OPTION;

mysql>GRANT ALL PRIVILEGES ON . TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

mysql>FLUSH PRIVILEGES;

mysql>EXIT

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

mysql修改密码及开启远程访问