mysql创建新用户的命令
//创建用户(用户名:min 密码:123)
- mysql> insert into mysql.user(Host,User,Password)
- values(“localhost”,“min”,password(“123″));
mysql> insert into mysql.user(Host,User,Password) values("localhost","min",password("123"));
//刷新系统权限表
- mysql>flush privileges;
mysql>flush privileges;
//授权min用户拥有tree数据库的所有权限
- mysq>grant all privileges on tree.* to min@localhost identified by ‘123′;
mysq>grant all privileges on tree.* to min@localhost identified by '123';
//删除用户
- mysql>DELETE FROM user WHERE User=“min” and Host=“localhost”;
mysql>DELETE FROM user WHERE User="min" and Host="localhost";
//修改用户密码
- mysql>update mysql.user set password=password(‘123456′)
- where User=“min” and Host=“localhost”;
最后更新:2017-01-04 22:34:37