//登錄MYSQL
@>mysql -u root -p
@>密碼
//創(chuàng)建用戶
mysql> insert into mysql.user(Host,User,Password) values("localhost","phplamp",password("1234"));
//刷新系統(tǒng)權(quán)限表
mysql>flush privileges;
這樣就創(chuàng)建了一個名為:phplamp 密碼為:1234 的用戶。
然后登錄一下。
mysql>exit;
@>mysql -u phplamp -p
@>輸入密碼
mysql>登錄成功
2.為用戶授權(quán)。
//登錄MYSQL(有ROOT權(quán)限)。我里我以ROOT身份登錄.
@>mysql -u root -p
@>密碼
//首先為用戶創(chuàng)建一個數(shù)據(jù)庫(phplampDB)
mysql>create database phplampDB;
//授權(quán)phplamp用戶擁有phplamp數(shù)據(jù)庫的所有權(quán)限。
>grant all privileges on phplampDB.* to phplamp@localhost identified by '1234';
//刷新系統(tǒng)權(quán)限表
mysql>flush privileges;
mysql>其它操作
/*
如果想指定部分權(quán)限給一用戶,可以這樣來寫:
mysql>grant select,update on phplampDB.* to phplamp@localhost identified by '1234';
//刷新系統(tǒng)權(quán)限表。
mysql>flush privileges;
*/
3.刪除用戶。
@>mysql -u root -p
@>密碼
mysql>DELETE FROM user WHERE User="phplamp" and Host="localhost";
mysql>flush privileges;
//刪除用戶的數(shù)據(jù)庫
mysql>drop database phplampDB;
4.修改指定用戶密碼。
@>mysql -u root -p
@>密碼
mysql>update mysql.user set password=password('新密碼') where User="phplamp" and Host="localhost";
mysql>flush privileges;
![](http://pic.uzzf.com/up/2016-12/20161213935322150.jpg)
- mysql數(shù)據(jù)庫64位【支持win7/win10】5.7.17.0 官方中文最新版
- mysql數(shù)據(jù)庫64位是最新的mysql數(shù)據(jù)庫版本了,同時也是支持中文的版本,在現(xiàn)在這個版本是可以支持win10的系統(tǒng)以及win8.1的版本,有需要體驗下這個mysql數(shù)據(jù)庫64位怎么樣的,可以先來本站免費的下載試試效果怎么樣!
語言:
中文大小:
350.9M類型:
數(shù)據(jù)庫更新:
2016-12-13推薦等級:
廠商: