建網(wǎng)站mysql添加用戶
作者:佚名 時間:2012-05-03 分享到:
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
給來自10.163.225.87的用戶joe分配可對數(shù)據(jù)庫vtdc所有表進行所有操作的權(quán)限,并設(shè)定口令為123。
mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
給來自10.163.225.87的用戶joe分配可對所有數(shù)據(jù)庫的所有表進行所有操作的權(quán)限,并設(shè)定口令為123。
mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
給本機用戶joe分配可對所有數(shù)據(jù)庫的所有表進行所有操作的權(quán)限,并設(shè)定口令為123。
mysql添加用戶方法
建立數(shù)據(jù)庫gamesp
create database gamesp;
添加用戶
grant all on 數(shù)據(jù)庫名.* to 用戶名@localhost identified by '密碼';
grant all on gamesp.* to newuser@localhost identified by 'password';
添加一個遠(yuǎn)程用戶,名為username密碼為password
GRANT ALL PRIVILEGES ON *.* TO " IDENTIFIED BY 'password'
說明:
(1)grant all 賦予所有的權(quán)限
(2)gamesp.* 數(shù)據(jù)庫 gamesp 中所有的表
(3)newuser 用戶名
(4)@localhost 在本地電腦上的 mysql server 服務(wù)器
(5)identfified by 'password' 設(shè)置密碼
刪除用戶
use mysql
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;
修改密碼
mysqladmin -uroot -plk317921web password "111111"