創建用戶并先定local訪問,密碼123
CREATE USER yy@localhost IDENTIFIED BY '123';
創建用戶不限制登錄
CREATE USER yy IDENTIFIED BY '123';
授權用戶
GRANT ALL PRIVILEGES ON *.* TO user;@localhost
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
格式:grant select on 數據庫.* to 用戶名@登錄主機 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';
刷新權限
flush privileges;