1.登录数据库
mysql -u root -p
2.使用mysql
use mysql
3.查询已授权用户
select User,Host from user;
4.更新指定用户
UPDATE `user` SET `Host` = '远程ip' where `Host` = '远程ip';
5.授权指定用户
GRANT ALL PRIVILEGES ON *.* TO 'root'@'远程ip' IDENTIFIED BY '数据库密码' WITH GRANT OPTION;
6.强制刷新
flush privileges;
网友评论