5月 072016
 

查询用户和权限

mysql> select * from mysql.user\G;

mysql> select * from mysql.user where user='root' \G;

mysql> show grants for root\G;

创建用户

mysql>use mysql;

mysql>insert into mysql.user(Host,User,Password) values("localhost","test",password("1234"));

删除用户

mysql>use mysql;

mysql>Delete FROM user Where User='test' and Host='localhost';

mysql>flush privileges;

修改密码

mysql>update mysql.user set password=password('newpwd') where User="test" and Host="localhost";

mysql>flush privileges;

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据