Mysql常用操作

时间:2015-01-06 15:47:58   收藏:0   阅读:170

mysql的常用操作

创建数据库用户:CREATE USER ‘username‘@‘localhost‘ IDENTIFIED BY ‘PASSWORD‘;

删除数据库用户:DELETE FROM user WHERE User="username" and Host="localhost";

给用户授权:    GRANT ALL PRIVILEGES ON *.* TO ‘uname‘@‘localhost‘ WITH GRANT OPTION;

更新用户密码:  use mysql; update user set password=password(‘PASSWORD‘) where user=‘username‘;

查看数据库用户:use mysql; select user,host from user;

查看数据库用户相应的权限:show grants for username@‘localhost‘;


评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!