解決辦法 grant all privileges on *.* to joe@localhost identified by
'1';
flush privileges;
拿 joe 1 登陸
附:
mysql>
grant 許可權1,許可權2,…許可權n on 資料庫
名稱.表名稱 to 使用者名稱@使用者地址
identified by ‘串連口令’;
許可權1,許可權2,…許可權n代表
select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file
等14個許可權。
當許可權1,許可權2,…許可權n被all privileges或者all代替,表示賦予使用者全部許可權。
當資料庫名稱.表名稱
被*.*代替,表示賦予使用者動作伺服器上所有資料庫所有表的許可權。
使用者地址可以是localhost,也可以是ip地址、機器名字、網域名稱。也可以
用’%'表示從任何地址串連。
‘串連口令’不可為空,否則建立失敗。
mysql>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>grant
all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
給
來自10.163.225.87的使用者joe分配可對資料庫vtdc所有表進行所有操作的許可權,並設定口令為123。
mysql>grant
all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
給來自
10.163.225.87的使用者joe分配可對所有資料庫的所有表進行所有操作的許可權,並設定口令為123。
mysql>grant
all privileges on *.* to joe@localhost identified by ‘123′;
給本機使用者joe
分配可對所有資料庫的所有表進行所有操作的許可權,並設定口令為123。