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

异常

在测试环境新搭建的MySQL服务端,启动后登陆MySQL如下异常:

[[email protected] ~]# mysql -u root -po2jSLWw0ni -h test177
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host 'test177' is not allowed to connect to this MySQL server

由于不能改变hostname,所以只能通过跳过数据库权限验证,来修改权限。

首先停止MySQL服务端

systemctl stop mysqld

/etc/my.cnf中的[mysqld]选项中添加跳过验证策略skip-grant-tables,my.cnf文件内容如下:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
skip-grant-tables

然后重新启动MySQL服务:

systemctl start mysqld

登陆数据库,通过以下两种方法修改权限:

通过表修改

use mysql;
update user set host = '%' where user = 'root' and host='localhost';
select host, user from user;

通过授权

GRANT ALL PRIVILEGES ON *.* TO 'account_name'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGES;

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

原文地址:https://www.cnblogs.com/linga/p/11457972.html

时间: 2024-08-02 07:25:49

ERROR 1130 (HY000): Host 'test177' is not allowed to connect to this MySQL server的相关文章

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

解决方法:1. 改表法.可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -uroot -p123456>use mysql;mysql>update user set host = '%' where u

1130 - Host 'localhost' is not allowed to connect to this MySQL server

打开Win7上的Navicat for MySQL后,连接localhost时,提示错误: 其解决方法是: 打开c:/Program Files/MySQL/MySQL Server 5.5下的my.ini文件,查看是否在在[mysqld]的段中存在: skip-grant-tables . 如果没有,添加即可. 目的是跳过MySQL的访问控制,任何人都可以在控制台以管理员的身份进入MySQL数据库. 注意: 在修改完密码以后要把MySQL服务器停掉重新启动才会生效.其方法是在win7中,打开控

1130 - Host ‘win7' is not allowed to connect to this mysql server

远程连接自己或别人的mysql时,弹出了提示:“1130 - Host ‘win7' is not allowed to connect to this mysql server”,意思是主机不允许连接到mysql服务器,不允许的原因是连接方没有足够的权限.解决办法有两个: 方法一:1)允许任何用户连接:update user set host='%' where user='root';flush privileges; 2)允许ip 192.168.1.3连接update user set

解决MySql报错:1130 - Host 'xxx' is not allowed to connect to this MySQL server的方法

发现问题 使用Navicat连接MySql数据库时,未能成功,提示信息如下图: 这个错误提示已经很明确了,"不允许主机'desktop-teat9ob'连接到此mysql服务器",知道问题所在就好解决了. 解决办法 我们远程联接到MySql服务器,打开服务器本地Navicat软件,在查询编辑器中执行下面的SQL语句 #查询允许连接的主机及用户信息 select Host,User,Password from mysql.user; 结果如下图: 从结果中可以看到,MySql只允许使用r

1130, "Host 'xxxx' is not allowed to connect to this MySQL server"

今天很坑爹的是在阿里云上装好了数据库,服务启动了,端口开了,安全组也配置了,但是在使用Navicat连接数据库的时候,就是连不上,一直提示1130错误. 我的原因是没有给其他主机访问本机的权限.处理方法如下: 登录mysql:mysql -uroot -p你的密码 再说一句题外话:使用xshell查看你的数据库服务是否开启,可以使用以下命令: 1130, "Host 'xxxx' is not allowed to connect to this MySQL server" 原文地址:

MySql数据库:Host 'localhost' is not allowed to connect to this MySQL server

修改mysql的root密码后,出现Host 'localhost' is not allowed to connect to this MySQL server 错误. 解决办法: C:\Program Files\MySQL\MySQL Server 5.5\my.ini 在[mysqld]下加下面两行, skip-name-resolveskip-grant-tables 重启mysql的windows服务 MySql数据库:Host 'localhost' is not allowed

message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决

解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql;   www.2cto.com mysql>update use

Host 'XXX' is not allowed to connect to this MySQL server 解决方案/如何开启MySQL的远程帐号

如何开启MySQL的远程帐号-1)首先以 root 帐户登陆 MySQL 在 Windows 主机中点击开始菜单,运行,输入“cmd”,进入控制台,然后cd 进入MySQL 的 bin 目录下,然后输入下面的命令.         > MySQL -uroot -p123456                 (123456 为 root 用户的密码.) 如何开启MySQL的远程帐号-2)创建远程登陆用户并授权        > grant all PRIVILEGES on test_db.

Host 'XXX' is not allowed to connect to this MySQL server 解决方案

一般出现此状况的是说明 'xxx'用户没有权限,那么就需要给用户的赋予权限. 如何开启MySQL的远程帐号-1)首先以 root 帐户登陆 MySQL 在 Windows 主机中点击开始菜单,运行,输入"cmd",进入控制台,然后cd 进入MySQL 的 bin 目录下,然后输入下面的命令. > MySQL -uroot -p123456                 (123456 为 root 用户的密码.) 如何开启MySQL的远程帐号-2)创建远程登陆用户并授权 >