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:(输入你的密码),进入到mysql之后输入命令:

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘yourpassword‘ WITH GRANT OPTION;  /*把命令中的‘yourpassword’换成你的数据库密码*/

修改以后再键入刷新使用权限命令:

FLUSH PRIVILEGES

这里不输入刷新权限命令的话也可以重启mysqld,命令:

service mysqld restart

完成后使用数据库管理工具连接服务器一切正常!

原文地址:https://www.cnblogs.com/52lnamp/p/9158424.html

时间: 2024-08-23 23:19:20

MySQL 1130 - Host 127.0.0.1 is not allowed to connect to this MySQL 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

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: 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&

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 '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 看当前所

远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server

ERROR 1130: Host ***.***.***.*** is not allowed to connect to this MySQL server 说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录. 需更改 mysql 数据库里的 user表里的 host项 把localhost改称% 具体步骤:登陆到MySQL 首先 use mysql: 按照别人提供的方式update的时候,出现错误. MySQL> update user set host='%' w

解决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

连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server

处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where user = 'root';  发现,host的值就是localhost. 所以将它的值改掉:update user set host='%' where user = 'root'; 3.修改完成后,执行:flush privileges; 将修改内容生效,再次配置时,用IP地址或者localhos