1舟奠、創(chuàng)建用戶test 并賦予密碼 1234567890
create user test identified by '1234567890';
用一下命令可以看到當(dāng)前數(shù)據(jù)庫中所有用戶
select Host,User from mysql.user;
2逊桦、指定數(shù)據(jù)庫給指定賬號(hào)
all代表接受所有操作,比如 select,insert,delete....;
testdb.* 代表testdb數(shù)據(jù)庫庫下面的所有表;
% 代表這個(gè)用戶允許從任何地方登錄;為了安全期間属百,這個(gè)%可以替換為你允許的ip地址;
grant all privileges on testdb.* to 'sy12315'@'%'identified by 'pwd12315#@!Q' with grant option;
3变姨、刷新權(quán)限
flush privileges;
4族扰、刪除某個(gè)用戶
Delete FROM user Where User='root' and Host='70.196.40.106';