grant all privileges on *.* to root@'%' identified by 'xxxx';
其它參數的例子:
grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by '123';
給來自10.163.225.87的用戶joe分配可對數據庫vtdc的employee表進行select,insert,update,delete,create,drop等操作的權限,并設定口令為123。
要重啟一次MYSQL才能使本地用戶密碼生效:
/usr/local/mysql/support-files/mysql.server restart