Chinaunix

标题: mysql添加用户、更改密码 [打印本页]

作者: toseeme_cu    时间: 2009-12-29 10:49
标题: mysql添加用户、更改密码

mysql添加用户方法
建立数据库gamesp
create database gamesp;
添加用户
grant  all  on  数据库名.*   to   用户名@localhost  identified  by  ’密码’;
grant all on gamesp.* to newuser
[email=newuser@localhost]@localhost[/email]
identified by ‘password’;
说明:
(1)grant all 赋予所有的权限
(2)gamesp.* 数据库 gamesp 中所有的表
(3)newuser 用户名
(4)@localhost 在本地电脑上的 mysql server 服务器
(5)identfified by ‘password’ 设置密码
删除用户
use mysql
mysql>Delete FROM user Where User=”xxxxx” and Host=”localhost”;
mysql>flush privileges;
修改密码
mysqladmin -uroot -plk317921web password “111111″


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/109134/showart_2133970.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2