is not allowed to connect to this MySQL server
服務(wù)器上面安裝的mysql數(shù)據(jù)庫(kù)在本地連接的時(shí)候報(bào)錯(cuò):is not allowed to connect to this MySQL server
出現(xiàn)這種情況的原因是因?yàn)椋?br> mysql數(shù)據(jù)庫(kù)只允許自身所在的本機(jī)器連接糕殉,不允許遠(yuǎn)程連接勤揩。
解決:
在mysql所在服務(wù)器上面登錄進(jìn)mysql數(shù)據(jù)庫(kù)中:
mysql -u root -p
use mysql;
select host from user where user='root';
可以看到 我們執(zhí)行查詢語(yǔ)句得到的數(shù)據(jù)結(jié)果中 host 的值是 localhost
我們執(zhí)行update語(yǔ)句把權(quán)限進(jìn)行修改, 然后 刷新配置寓落,就能鏈接上
update user set host = '%' where user ='root';
flush privileges;