解决ERROR 1130: Host 'x.x.x.x' is not allowed to connect to this MariaDB server 方法

问题描述

在使用SQLyog操作Linux上的MariaDB时候,会出现如下错误:

解决方法

改表法

可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称”%
具体操作为:

连接mysql服务器:mysql -u root -p
看当前所有数据库:show databases;
进入mysql数据库:use mysql;
查看mysql数据库中所有的表:show tables;
查看user表中的数据:select Host, User,Password from user;
修改user表中的Host:update user set host = '%' where user = 'root';
刷新授权列表:flush privileges;

通过以上操作,再重新连接便成功

授权法

例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

参考:https://blog.csdn.net/july_2/article/details/41896295

解决ERROR 1130: Host 'x.x.x.x' is not allowed to connect to this MariaDB server 方法

原文地址:https://www.cnblogs.com/WindSun/p/12142636.html

时间: 2024-08-11 09:56:46

解决ERROR 1130: Host 'x.x.x.x' is not allowed to connect to this MariaDB server 方法的相关文章

遇到问题,本地PHP环境连接其他主机的Mysql 出现ERROR 1130: Host '192.168.1.222' is not allowed to connect to this MySQL server

问题描述,1 检查mysql服务是否启动, 2 关闭防火墙                    Netfilter/Iptables    关闭方式[[email protected] ~]#iptables -F                    SELINUX     关闭方式 [[email protected] ~]#setsebool -P samba_enable_home_dir on             3 查看是否有监听mysql端口  netstat -an |gr

mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server

mysql -u root -p  mysql;use mysql;  mysql;select 'host' from user where user='root';  mysql;update user set host = '%' where user ='root';  mysql;flush privileges; mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL se

Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server

通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server说明你所连接的用户账户没有远程连接的权限,只能在本机localhost登录需要更改 mysql 数据库里的 user表里的 host字段 把localhost改称%下面是我设置的远程连接步骤,请参考: 1.登录MySQL  mysql -uroot -proot2.进入数据库

ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL

当使用Mysql帐号远程登陆的时候,出现类似如下错误:ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL 解决办法: 1. 改表法(可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost&

ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' where user='root'; ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会 flush privileges; 重新远程连接OK ERROR 1130: Host '192.168.1.3' is not allo

1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server解决Navicat连接MySQL报错

最近使用Navicat for MySQl访问远程mysql数据库,出现报错,显示"1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server".解决办法如下: 方法/步骤 首先看报错窗口. 经查阅,错误原因是:本地IP(xxx.xxx.xxx.xxx)没有访问远程数据库的权限. 于是下面开启本地IP(xxx.xxx.xxx.xxx)对远程mysql数据库的访问权限. 首先远程连接进入服务器,在

ERROR 1130 (HY000): 192.168.111.1'' is not allowed to connect to this MySQL server

root 无法通过navicat 远程以root登录 虚机授予权限并刷新 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; FLUSH PRIVILEGES; ERROR 1130 (HY000): 192.168.111.1'' is not allowed to connect to this MySQL server

MySQL 1130 - Host 127.0.0.1 is not allowed to connect to this MySQL server

在开发中为了让开发更方便,在本地配置环境,希望可以直接访问服务器上的MySQL数据库,更方便的管理数据库, 需要在本地远程连接linux服务器的本地数据库,直接用数据库管理工具连接出现如下报错1130 - Host 127.0.0.1 is not allowed to connect to this MySQL server: 这个错误说明MySQL没有允许远程登录,只要授权可以远程登录就ok了. 登录到服务器上,mysql -u root -p 回车,password:(输入你的密码),进入

解决ERROR 1130 (HY000): Host '192.168.1.9' is not allowed to connect to this MySQL server

本机是mysql的数据库,想用另一台ip为192.168.1.9的连接这个mysql数据库,可是报了这个错误. 查询得到2个方法 第一个是在user表把localhost改为%, 我这么做后不仅没有解决,本地连接都要[email protected]%这么做了(现在想想好像失误把所有localhost都给改了). 第二个方法就生效了. 终端登陆mysql,执行一句sql: GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.9' IDENTIFIED