码迷,mamicode.com
首页 > 数据库 > 详细

Mysql常用操作

时间:2015-01-06 15:47:58      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:localhost   password   update   mysql   数据库   

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‘;


Mysql常用操作

标签:localhost   password   update   mysql   数据库   

原文地址:http://leejung.blog.51cto.com/8917264/1599698

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!