fanlong0212

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

题描述:Navicat 为管理方便,连接Linux 中Mariadb失败,如下如下错误:Host '*' is not allowed to connect to this MariaDB server

解决方案:

//允许用户testuser从ip为222.129.1.1的主机连接到mysql服务器,并使用testpassword作为密码
MariaDB [(none)]> grant all privileges on *.* to 'testuser'@'222.129.1.1' identified by 'testpassword' with grant option;  
(若是允许所有ip:GRANT ALL PRIVILEGES ON *.* TO ‘testuser’@'%’ IDENTIFIED BY ‘testpassword’ WITH GRANT OPTION;)
MariaDB [(none)]> flush privileges;   //刷新权限缓存
MariaDB [(none)]> show privileges;
MariaDB [(none)]> show grants for  'testuser'@'222.129.1.1'

  

posted on 2019-03-20 10:20  fanlong0212  阅读(637)  评论(0编辑  收藏  举报