Front end developers must read! Starting from scratch, teach you to build a low code website platform in stages>>>
There are two reasons for this phenomenon, one is that the current user is rejected by the MySQL server, the other is that port 3306 is banned by the firewall and cannot be connected to the port. The solution is as follows:
1. Set remote user access rights:
//Any remote host can access the database
mysql> GRANTALLPRIVILEGESON*.*TO’root’@’%’WITHGRANTOPTION;
//You need to enter a command for the modification to take effect
mysql> FLUSHPRIVILEGES;
//Exit
mysql> EXIT
Sometimes it’s easy to develop ports on the alicloud console
After entering iptables, we found that port 3306 is not open, so we can only tap it in iptables with our hands
2. Open port 3306 in iptables
#/SBIN/iptables iinput PTCP — dport3306-j accept
Restart service
However, this is not recommended as it can cause security issues
Note: sometimes it’s not easy to add a port to the console. You might as well go into iptables to see if you really add rules
Similar Posts:
- [Solved] MYSQL Remote connection 2003 Error: can’t connect to MYSQL server on ”(10060)
- [Solved] MYSQL ERROR 2003 (HY000): can’t connect to MySQL server (10060)
- [Solved] SQLSTATE[HY000] [2003] Can’t connect to MySQL serv
- When Navicat connects to a database on a server, there is an error prompt: 1130 ‘* *’ host is not allowed to connect to this MySQL server
- [Solved] MySQL Connect Error: Can’t connect to MySQL server on ‘ ‘(61)
- [Solved] 2003 – cant connect o mysql server on xxx (10060 unknown error)
- [Solved] CentOS 7.9 Install MySQL Error: 2003- cannot connect to mysql server on ‘10.10.1.202’(10060 “Unknown error”)
- [Solved] CentOS 7.2 Startup Error: Failed to start IPv4 firewall with iptables
- When installing MySQL database on MAC, the system prompts MySQL: command not found
- The solution of 2003 can’t connect to MySQL server on ‘localhost’ (10061)