鍍金池/ 問(wèn)答/iOS  數(shù)據(jù)庫(kù)  網(wǎng)絡(luò)安全  HTML/ xampp 出現(xiàn)問(wèn)題 Host is not allowed to connec

xampp 出現(xiàn)問(wèn)題 Host is not allowed to connect to this MariaDB server

請(qǐng)問(wèn)一下 我用 http://localhost/ 訪問(wèn)出現(xiàn)錯(cuò)誤:

Host is not allowed to connect to this MariaDB server

突然變這樣,我不知道為何!
是哪裡有問(wèn)題?
我也用xampp重新啟動(dòng)mysql了還是一樣!
我發(fā)現(xiàn)是遠(yuǎn)程連線的問(wèn)題

因?yàn)槲疫B接數(shù)據(jù)庫(kù)是用server IP (linode)
我做了以下的指令

MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'xxx.xxx.xx.xx' IDENTIFIED BY 'xxx' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

xxx.xxx.xx.xx 是我那臺(tái)server 的IP
只是我接下來(lái)要打

MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxx' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

我從localhost還是沒(méi)辦法讀取到數(shù)據(jù)
Host is not allowed to connect to this MariaDB server

回答
編輯回答
尋仙

當(dāng)你在使用mysql或者mariadb的時(shí)候,在對(duì)用戶權(quán)限類進(jìn)行操作后,需要在mysql當(dāng)中執(zhí)行

flush privileges;

flush privileges;使用來(lái)重新加載權(quán)限表,使你剛才所做的權(quán)限操作生效

2017年10月4日 11:12