ERROR 1130 (HY000): Host 'test177' is not allowed to connect to this MySQL server
异常
在测试环境新搭建的MySQL服务端,启动后登陆MySQL如下异常:
[root@test177 ~]# 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的更多相关文章
- mysql error 1130 hy000:Host 'localhost' is not allowed to connect to this mysql server 解决方案
ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server D:\Wamp\mysql-\b ...
- ERROR 1130 (HY000) Host ‘hostname’ is not allowed to connect to this MySQL server
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; FLUSH PRIVILEGES;
- 错误号码1130:Host 'XXX' is not allowed to connect to this MySQL server
今天在linux机器上装了一个mysql,想通过sqlyog远程连接过去,发生了:错误号码1130:Host 'XXX' is not allowed to connect to this MySQL ...
- Mysql数据库连接报错!1130:host XXX is not allowed to connect to this mysql server
我猜想是可能是连接的用户权限问题.结果这样子操作mysql库,可以解决此问题.在本机登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost” ...
- ERROR 1130: Host xxx is not allowed to connect to this MySQL server
在使用MySQL-Front连接mysql的时候发生的这个错误 ERROR 1130: Host xxx is not allowed to connect to this MySQL server ...
- 远程连接mysql报错【1130 -host 'localhost' is not allowed to connect to this mysql server】
远程连接mysql时包如下错误: 1130 -host 'localhost' is not allowed to connect to this mysql server 解决办法 本地用root账 ...
- mysql报错:1130 -host 'localhost' is not allowed to connect to this mysql server
错误提示:1130 -host 'localhost' is not allowed to connect to this mysql server 原因:手贱把mysql数据库系统中mysql数据库 ...
- 连接远程数据库时出现 SSH: expected key exchange group packet from server / 2003 - Can't connect to MySQL server on 'XXX' (10038) / 1130 - Host 'XXX' is not allowed to connect to this MySQL server
昨天在自己的远程服务器上玩,把系统重装了.新装了MySQL,在本地用navicat连接的时候出了几个小问题. 问题一:SSH: expected key exchange group packet f ...
- 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:\Progr ...
随机推荐
- 关于CPU的一些操作(CPU设置超频)
常见的几种CPU模式: .ondemand:系统默认的超频模式,按需调节,内核提供的功能,不是很强大,但有效实现了动态频率调节,平时以低速方式运行,当系统负载提高时候自动提高频率.以这种模式运行不会因 ...
- 执行sql语句,不依靠实体 获取string值
IList<string> list2 = Session.CreateSQLQuery(sql.ToString()).List<string>();
- JS基础_代码块
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- O050、Create Volume 操作 (Part I)
参考https://www.cnblogs.com/CloudMan6/p/5603312.html 前面已经学习了Cinder的架构和相关组件,从本节开始详细分析 Cinder 的各种操作,首先 ...
- winfrom---Window 消息大全
最近正在捣腾winfrom,遇到了关于window消息这一块的东西,正好在网上看到“微wx笑”的总结. 原文地址:http://blog.csdn.net/testcs_dn/article/deta ...
- Windows命令行命令总结
转载地址:https://www.cnblogs.com/accumulater/p/7110811.html 1. gpedit.msc-----组策略 2. sndrec32-------录音 ...
- 利用fadeTo改变元素的不透明度代码
有很多的图片网站中有这样的一种效果:鼠标划过某个元素的时候,与他同级的其他元素的透明度会降低,突出显示这个元素,比如聚美优品的网站就多少用到了这个特效,效果图如下: 不多说,干货代码如下: html部 ...
- flex整页布局
使用flex进行整页的三列布局,flex:1下的子元素无法铺满父级.给flex:1元素,添加stretch拉伸 display: flex; align-content: stretch; align ...
- C++ void*解惑
最近遇到void *的问题无法解决,发现再也无法逃避了(以前都是采取悄悄绕过原则),于是我决定直面它. 在哪遇到了? 线程创建函数pthread_create()的最后一个参数void *arg,嗯? ...
- SpringBoot-核心依赖说明
spring-boot-dependencies 一般用来放在父项目中,来声明依赖,子项目引入相关依赖而不需要指定版本号,好处就是解决依赖冲突,统一管理依赖版本号 利用pom的继承,一处声明,处处使用 ...