MySQL can be connected using localhost, but cannot be connected using an IP address.
MySQL localhost connection, but cannot use IP address connection Solution
It mainly involves the problem that MySQL can be connected by localhost but cannot be connected by IP address. For MySQL, it can be connected by localhost but cannot be connected by IP address.
1. Open the cmd window and enter the bin directory installed by MySQL.
2. Run the command to log on to the database. Then, a line of mysql-u root-p asking you to enter the password will appear.
3. Run the following command to assign a new user:
Grant all privileges on *. * to 'root' @ '%' identified by 'root'; (%) indicates all ip addresses
4. Run the preceding command to refresh the permission.
Flush privileges;
5. Close the mysql service and start the mysql service.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!