?
本文檔使用 php中文網(wǎng)手冊(cè) 發(fā)布
這一章節(jié)是記錄在學(xué)習(xí)過(guò)程中遇到的一些關(guān)于MySQL安裝過(guò)程中的筆記
安裝完數(shù)據(jù)庫(kù)記得清除默認(rèn)的無(wú)用數(shù)據(jù),減少潛在危險(xiǎn)
drop database test; #刪除默認(rèn)數(shù)據(jù)庫(kù) delete from mysql.user where user=''; #刪除不需要的用戶
用戶授權(quán)(with grant option 參數(shù)意為被授權(quán)的用戶擁有給其他用戶授權(quán)的權(quán)力)
grant all prilieges on *.* to test@'192.168.1.%' identified by 'aaaaaa' with grant option;
授權(quán)所有庫(kù)所有表的所有權(quán)限給test用戶
該用戶只能通過(guò)ip為192.168.1.(1~254)
登錄,密碼為aaaaaa
且該用戶有管理用戶的權(quán)限
grant creat,select,insert,update,delete on onethink.* to 'onethink'@localhost identified by 'yourPassword';
安裝完后,回收 create
權(quán)限,保留 insert
,delete
,updaet
,select
權(quán)限。
revoke create on onethink.* from 'onethink'@localhost;