xampp 出現問題 Host is not allowed to connect to this MariaDB server

請問一下 我用 http://localhost/ 訪問出現錯誤:

Host is not allowed to connect to this MariaDB server

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

因為我連接數據庫是用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還是沒辦法讀取到數據
Host is not allowed to connect to this MariaDB server

阅读 5.1k
1 个回答

当你在使用mysql或者mariadb的时候,在对用户权限类进行操作后,需要在mysql当中执行

flush privileges;

flush privileges;使用来重新加载权限表,使你刚才所做的权限操作生效

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题