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

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

請問一下 我用 http://localhost/ 訪問出現(xiàn)錯誤:

Host is not allowed to connect to this MariaDB server

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

因為我連接數(shù)據(jù)庫是用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 是我那臺server 的IP
只是我接下來要打

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

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

回答
編輯回答
尋仙

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

flush privileges;

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

2017年10月4日 11:12