Host is not allowed to connect to this MariaDB server

使用Navicat连接数据库时出现了 Host xxx is not allowed to connect to this MariaDb server 的情况。发现了是因为授权的问题,使得连接权限受阻。所以,只需要进入数据库中,给予其权限即可。具体解决代码如下:

[root@localhost ~]# mysql -u root -p
Enter password:

#首先进入mysql数据库中

MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.15 sec)

#进入之后,输入以下代码,目的是将登录的主机设置为全部都能登录

MariaDB [(none)]> flush privileges;

Query OK, 0 rows affected (0.13 sec)

#随后,直接更新服务。或者直接重启mariadb server服务

MariaDB [(none)]> exit;
Bye

#退出数据库,结束!

然后再使用navicat连接使用就能连接到了。

 

相关文章

安装开始...1.打开“https://dev.mysql.com/downloadsepo/yu...
安装Helm3#官网下载慢#wgethttps://get.helm.sh/helm-v3.5.4...
通过Linux命令行启动用的指令:systemctlstartmariadb.servi...
InstallingMariaDBServer10.4TodeployMariaDBCommunityServe...
阅读目录一什么是存储引擎二mysql支持的存储引擎三使用存储引...
1、安装MariaDB安装命令yum-yinstallmariadbmariadb-server安...