Remote connection to MySQL fails, there may be the following reasons: 1. Young man/girl, please make sure you have entered your IP address correctly! ! 2. Network or firewall issues 1) Troubleshoot network problems Use the command: ping 192.168.1.1 to check whether the network request has timed out. Receive data normally and proceed to the next step of investigation 2) Check whether the cloud server firewall is blocking it. Use the command: telnet 192.168.1.1 3306. If the connection fails, there are two reasons. a) Check whether the cloud server port is open. Open status (I use Alibaba Cloud): Open port configuration: If the cloud server port is already open. But the server's port 3306 is still not accessible. Continue reading below. b) Check the server to see if the firewall is turned on. # systemctl status firewalld My server is not open, so there is no such thing as being blocked by the firewall. If the firewall is enabled and telnet still fails, use netstat to check the status of port 3306: # netstat -talnp 3306tcp6 0 0 :::3306 :::* LISTEN 4591/mysqld (normal situation) If the netstat 3306 port does not show the above situation. Then you need to start the MySQL service on your local machine and connect offline again. 3. Check user access rights 1) Enter msyql 2) View user access rights As shown in the figure, check whether the Host corresponding to your remote account (User) is %; If the Host corresponding to the remote account is 127.0.0.1/localhost, then this user can only access the local machine. Other machines have no permission to access with this user account. The host must be changed to %, indicating that all machines are allowed to access. Modify the command as follows: mysql> update user set host='%' where user='the account you want to modify'; ##After the modification is successful, remember to refresh the permissions mysql> flush privileges; Finally, check the permissions and connect remotely. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Solve the problem of Tomcat10 Catalina log garbled characters
>>: Summary of three ways to create new elements
Find the problem Recently, when I was filling in ...
for loop The for loop loops through the elements ...
This article example shares the specific code of ...
1. What is Docker? Everyone knows about virtual m...
background When you open the product details on s...
Table of contents 1. js memory 2. Assignment 3. S...
introduce A chart is a graphical representation o...
Table of contents Vue first screen performance op...
7 ways to implement a two-column layout with fixe...
Table of contents 1. Enter the network card confi...
I have seen many relevant tutorials on the Intern...
The difference between replace into and insert in...
Table of contents Short Polling Long-Polling WebS...
First, let’s take a look at the picture: Today we...
Let’s take a look at the renderings first: XML/HT...