mysql 新建用户授权远程访问
Posted wonderfang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 新建用户授权远程访问相关的知识,希望对你有一定的参考价值。
新建用户
insert into mysql.user(Host,User,Password) values("localhost","u",password("123")); flush privileges; grant all privileges on uDB.* to [email protected] identified by ‘123‘; flush privileges; grant select,update on uDB.* to [email protected] 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;
以上是关于mysql 新建用户授权远程访问的主要内容,如果未能解决你的问题,请参考以下文章