創(chuàng)建用戶并先定local訪問夷都,密碼123
CREATE USER yy@localhost IDENTIFIED BY '123';
創(chuàng)建用戶不限制登錄
CREATE USER yy IDENTIFIED BY '123';
授權(quán)用戶
GRANT ALL PRIVILEGES ON *.* TO user;@localhost
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
格式:grant select on 數(shù)據(jù)庫.* to 用戶名@登錄主機(jī) identified by “密碼”
修改密碼
grant all privileges on pureftpd.* to koko@localhost identified by 'mimi';
查看用戶信息
select host,user from mysql.user;
刪除用戶
Delete FROM user Where User='test' and Host='localhost';
刷新權(quán)限
flush privileges;