标签:update 输入 admin password nbsp where insert 用户登陆 新建用户
mysql>exit;
@>mysql -u phplamp -p
@>输入password
mysql>登录成功
2.为用户授权。
格式:grant 权限 on 数据库.* to username@登录主机 identified by "password";
>grant all privileges on phplampDB.* to phplamp@localhost identified by ‘1234";
授权test用户拥有全部数据库的某些权限:
mysql>grant select,delete,update,create,drop on *.* to test@"%" identified by "1234";
//test用户对全部数据库都有select,delete,update,create,drop 权限。
//@"%" 表示对全部非本地主机授权。不包含localhost。(localhost地址设为127.0.0.1。假设设为真实的本地地址,不知道能否够,没有验证。)
//对localhost授权:加上一句grant all privileges on testDB.* to test@localhost identified by ‘1234‘;就可以。
3.删除用户。
@>mysql -u root -p
@>password
mysql>DELETE FROM user WHERE User="test" and Host="localhost";
mysql>flush privileges;
//删除用户的数据库
mysql>drop database testDB;
4.改动指定用户password。
@>mysql -u root -p
@>password
mysql>update mysql.user set password=password(‘新密码‘) where User="test" and Host="localhost";
mysql>flush privileges;
delete from user where User="test" and Host="localhost";
也能够试试:
删除账户及权限:>drop user username@‘%‘;
>drop user username@ localhost;
标签:update 输入 admin password nbsp where insert 用户登陆 新建用户
原文地址:http://www.cnblogs.com/mfmdaoyou/p/7001010.html