mysql

第一步:

mysql -u root -p

第二步:

use mysql;

第三步:

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

第四步:

select host, user from user;

授权:如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码

GRANT ALL PRIVILEGES ON . TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

原文链接:https://blog.csdn.net/weixin_31061699/article/details/113690680

posted on 2022-05-12 08:27  super-brother  阅读(41)  评论(0编辑  收藏  举报