mysql 新建用户、授权、远程访问

新建用户

insert into mysql.user(Host,User,Password) values("localhost","u",password("123"));
flush privileges;
grant all privileges on uDB.* to u@localhost identified by '123';
flush privileges;
grant select,update on uDB.* to u@localhost identified by '123';
flush privileges;
DELETE FROM user WHERE User="u" and Host="localhost";
flush privileges;

  

远程访问

update mysql.user set host = '%' where user = 'u';
grant all privileges on *.* to 'u'@'%' identified by '123'

  

权限回收

revoke privileges on dbname[.tbname] from username;

  

上一篇:opencv之图像腐蚀


下一篇:.NetCore&Linux&Docker&Portainer踩坑历险记