当前位置:网站首页>Two methods for MySQL to open remote connection permission
Two methods for MySQL to open remote connection permission
2022-06-30 16:14:00 【1024 Q】
An evaluation system is required , Because I have been done a small part before , There's a database out there ( database :MySQL 5.7 , Database software :MySQL workbench 6.3 CE), In order to save the trouble of installing database export and import tables , You want to connect to the other party's database directly and remotely .
The method is as follows :First , Check whether the firewall of the server to connect to the database is closed , Check whether the connection with the server is smooth ( Method : stay cmd Console Input ping ip Address )
Secondly, there are two ways to search through the Internet :1, Modified table method .Maybe your account doesn't allow remote login , Only in localhost. At this time, as long as localhost The computer of , Log in mysql after , change "mysql" In the database "user" Exterior and interior "host" term , from "localhost" rename "%"
mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;2, The law of authorization . In the installation mysql Running on the machine :
1、d:\mysql\bin\>mysql -h localhost -u root
// This should allow access to MySQL The server
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION
// Give any host access to data
3、mysql>FLUSH PRIVILEGES
// The amendment takes effect
4、mysql>EXIT
// sign out MySQL The server
This allows you to run on any other host with root I'm logged in .
You can't test either method by yourself , It's strange , So I tested myself :
find MySQL File location of , stay cmd Input in cd mysql.exe File location of ( Generally in MySQL Installation directory bin Under the document )
Input mysql -u root -p Enter the login password to login MySQL

stay MySQL Input directly in GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION , It will appear as follows

This is because there is no semicolon in English .
Try typing a statement with a semicolon :

Prompt no rows found .
I decided to use the first method first , The code according to the first method , Input :
mysql -u root -p // This is login. mysql>use mysql; // mysql>update user set host = '%' where user = 'root'; // mysql>select host, user from user; //The results are shown in the following figure

Connect remote MySQL, Still not connected , So try the second way
Input :
d:\mysql\bin\>mysql -h localhost -u root mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; mysql>FLUSH PRIVILEGES; mysql>EXIT;Be sure to end here with a semicolon !!!
The results are shown in the following figure

At this time, there is no above ERROR 1133 Wrong. , After testing , You can already connect to the remote server .
The general implementation steps are as follows :
Reference article :
http://www.cnblogs.com/ycsfwhh/archive/2012/08/07/2626597.html
http://zhidao.baidu.com/link?url=knBlHE7vm912Lr_1c1OKlL_OYoyuuYQrRo4zLHbBYytBsjAP1VRCJFtZAOkBMMzDm_2kk69UlrE4RDdMwUO6X6SfFjRYKoUTMYnVPZrIvvm
summaryThis is about MySQL This is the end of the article on the two methods of opening remote connection permissions , More about MySQL For the content of open remote connection permission, please search the previous articles of the software development network or continue to browse the following related articles. I hope you can support the software development network in the future !
边栏推荐
- 《你的灯亮着吗》开始解决问题前,得先知道“真问题”是什么
- 360 digital, ant group, etc. were selected as member units of the "business security promotion plan" of the Chinese Academy of Communications
- [CVE-2019-0193] - Apache Solr DataImport 远程命令执行分析
- Is your light on? Before you start to solve a problem, you need to know what the "real problem" is
- topic: Privacy, Deception and Device Abuse
- Phone number shielding function
- 爬虫(1) - 爬虫基础入门理论篇
- Generating verification code with sring
- 今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
- 数数据可视化实战案例(timeline轮播图,streamlit 控件年份 metabase可视化使用教程)2.0
猜你喜欢

Swagger's asp Net core web API help page

ADB devices cannot detect the problem of Xiaomi note 3

CVPR 2022丨特斯联AI提出:基于图采样深度度量学习的可泛化行人重识别

优惠券种类那么多,先区分清楚再薅羊毛!

Mysql事务/锁/日志总结

Simulate user login function

Policy Center > Device and Network Abuse

ASP. Net core signalr tutorial

'<', Hexadecimal value 0x3c, is an invalid problem solving

Google play index table
随机推荐
Joint examination for management -- sample composition
from Crypto. Cipher import AES could not find the solution record with module error
Open source STM32 USB-CAN project
Policy Center > Malware > Malware
[附下载]渗透测试神器Nessus安装及使用
MySQL8.0开启远程连接权限的方法步骤
深入理解.Net中的线程同步之构造模式(二)内核模式1.内核模式构造物Event事件
topic: Privacy, Deception and Device Abuse
What is XR extended reality and what are the XR cloud streaming platforms
How to browse mobile web pages on your computer
CloudXR如何推动XR的未来发展
边缘计算平台如何助力物联网发展
几百行代码实现一个 JSON 解析器
KDD 2022 | 我们离通用预训练推荐模型还有多远?推荐系统的通用序列表示学习模型 UniSRec
深入分析GadgetInspector核心代码
Modifying MySQL password under Linux: error 1396 (HY000): Operation alter user failed for 'root' @ 'localhost‘
数数据可视化实战案例(timeline轮播图,streamlit 控件年份 metabase可视化使用教程)2.0
'<', hexadecimal value 0x3C, is an invalid 问题解决
渲染引擎的资源加载优化
map reduce案例超详细讲解