当前位置:网站首页> MySQL8.0开启远程连接权限的方法步骤
MySQL8.0开启远程连接权限的方法步骤
2022-06-30 15:41:00 【1024问】
问题描述:
报错原因:
解决方法:
总结
问题描述:开发环境:MySQL8+Centos8;
执行MySQL语句:mysql -h 180.76.XXX.XX -u root -pPassword;
ERROR 1130 (HY000): Host ‘180.76.XXX.XX’ is not allowed to connect to this MySQL server
解决方法:首先,检查要连接数据库的服务器的防火墙等是否关闭,检查与服务器连接是否通畅(方法:在cmd控制台中 输入 ping ip地址)
接下来,进入正题:
具体操作步骤如下:
登录本地MySQL库, 切换至database= “mysql” 下,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从"localhost"改称"%" :
执行的mysql命令如下:
【1】mysql命令连接要开启远程连接权限的本地mysql库>mysql -u root -pPassWord # ”root“为登录账号,”Password“为登录密码,按自己设置的修改>use mysql; # 使用的database名称为”mysql“>update user set host = '%' where user = 'root'; # 修改”root“账号的配置信息# update user set host='%' where user='test'; ## 如果账号是“test”,使用该命令>select host, user from user; # 验证修改成功;在mysql命令行的具体执行结果如下图:

2. 此时“如果连接远程MySQL,还是没连接上”时,则再继续执行操作 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;进行账号授权,之后执行FLUSH PRIVILEGES; 进行刷新,即可。" :
>mysql -u root -pPassWord # ”root“为登录账号,”Password“为登录密码,按自己设置的修改 # 连接MySQL数据库>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; # 授权# Grant all privileges on test.* to 'test'@'%'; # 如果账号为“test”时,使用该命令>FLUSH PRIVILEGES; # 刷新>EXIT; # 退出MySQL在mysql命令行的具体执行结果如下图:

备注:注意这里一定要以英文分号结尾!!!
这时没有上面的ERROR 1133错误了,经过测试,已经能连接到远程服务器了。
总的执行步骤如下:

参考文献:
对MySQL开放远程连接权限的方法
解决mysql8报错:ERROR 1410 (42000): You are not allowed to create a user with GRANT
总结到此这篇关于MySQL8.0开启远程连接权限的文章就介绍到这了,更多相关MySQL8.0开启远程连接权限内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- Map reduce case super detailed explanation
- ASP. Net core signalr series hub tutorial
- 阿里云oss对象存储跨域设置
- How the edge computing platform helps the development of the Internet of things
- 4.1 print function
- 婴儿认知学习所带来的启发,也许是下一代无监督机器学习的关键
- 渲染引擎的资源加载优化
- 4.2 escape characters
- 各省GDP可视化案列,附带csv Metabase处理
- [leetcode] linked list sorting (gradually increasing the space-time complexity)
猜你喜欢

Imeta | Ye Mao / Shi Yu reviewed the dynamic shuttle and ecological function of intracellular and extracellular genes in the environmental microbiome

Visualization of provincial GDP with CSV metabase processing

Practical cases of data visualization (timeline rotation diagram, streamlit control year metabase visualization tutorial) 2.0

map reduce案例超详细讲解

各省GDP可视化案列,附带csv Metabase处理

电子烟强制性国家标准GB 41700-2022发布 2022年10月1日起实施

topic: Privacy, Deception and Device Abuse

婴儿认知学习所带来的启发,也许是下一代无监督机器学习的关键

开源 STM32 USB-CAN项目

数数据可视化实战案例(timeline轮播图,streamlit 控件年份 metabase可视化使用教程)2.0
随机推荐
Policy Center > Malware > Malware
Three development trends of enterprise application viewed from the third technological revolution
[cve-2019-0193] - Apache Solr dataimport remote command execution analysis
Model system: Sword (1)
Flask Sqlalchemy - how to use custom query criteria ---orm (7)
云化XR,如何助力产业升级
消息队列十连问
What are the reasons for the errors reported by the Flink SQL CDC synchronization sqlserver
How to get the preferential activities for stock account opening? Is online account opening safe?
终于看懂科学了!200张图领略人类智慧的巅峰
Visualization of provincial GDP with CSV metabase processing
Create a new MySQL database under Linux and import SQL files
波导的种类
Message queue ten questions
How the edge computing platform helps the development of the Internet of things
Map reduce case super detailed explanation
topic: Privacy, Deception and Device Abuse
Lecun points out the direction of next generation AI: autonomous machine intelligence
Simulation of two-color ball system to judge the winning situation
Table responsive layout tips for super nice