mysql远程连接

use mysql;
// 修改一条 root 数据,并刷新MySQL的系统权限相关表
update user set Host = '%' where Host = 'localhost' and User = 'root';
flush privileges;
// grant 命令重新创建一个用户
grant all privileges on *.* to root@"%" identified by "root";

添加用户授权(不会覆盖之前的权限)
grant all privileges on *.* to 'username'@'%' identified by '密码' with grant option;  

添加权限(和已有权限合并,不会覆盖已有权限)
GRANT Insert ON `your database`.* TO `user`@`host`;

删除权限
REVOKE Delete ON `your database`.* FROM `user`@`host`;

flush privileges;

posted on 2021-09-09 12:47  lodger47  阅读(28)  评论(0编辑  收藏  举报

导航