一、mysql服務操作 0、查看數(shù)據(jù)庫版本 sql-> status; 1、net start mysql //啟動mysql服務 2、net stop mysql //停止mysql服務 3、mysql -h主機地址 -u用戶名 -p用戶密碼 //進入mysql數(shù)據(jù)庫 4、quit //退出mysql操作 5、mysqladmin -u用戶名 -p舊密碼 password 新密碼 //更改密碼 6、grant select on 數(shù)據(jù)庫.* to 用戶名@登錄主機 identified by "密碼" //增加新用戶 exemple: 例2、增加一個用戶test2密碼為abc,讓他只可以在localhost上登錄,并可以對數(shù)據(jù)庫mydb進行查詢、插入、修改、刪除的操作 (localhost指本地主機,即MYSQL數(shù)據(jù)庫所在的那臺主機),這樣用戶即使用知道test2的密碼,他也無法從internet上直接訪問數(shù)據(jù) 庫,只能通過MYSQL主機上的web頁來訪問了。 grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc"; 如果你不想test2有密碼,可以再打一個命令將密碼消掉。 grant select,insert,update,delete on mydb.* to test2@localhost identified by "";