解决"Can't connect to MySQL server on 'localhost:3306' (10061)"错误
The error message suggests that the MySQL server is not running on your localhost or the port 3306 is not open. \n\nTo troubleshoot this issue, you can follow these steps:\n\n1. Check if the MySQL service is running. You can do this by opening the Services panel (press Win + R, then type "services.msc" and press Enter), and look for "MySQL" or "MySQL Server" in the list. If it is not running, start the service.\n\n2. If the service is running, check if the MySQL server is listening on port 3306. Open a command prompt and type the following command: telnet localhost 3306. If the connection is successful, you will see a blank screen. If not, it means the port is not open.\n\n3. If the port is not open, you may need to configure your firewall to allow incoming connections on port 3306. The steps to do this vary depending on the firewall software you are using. Consult the documentation or support resources for your firewall to learn how to open a port.\n\n4. If the port is open and the MySQL service is running, it is possible that there is an issue with the MySQL configuration. Check the MySQL configuration file (usually located at /etc/my.cnf or /etc/mysql/my.cnf) and ensure that the server is listening on the correct IP address and port.\n\n5. If none of the above steps resolve the issue, it is possible that there is a problem with the MySQL installation. Try reinstalling MySQL or consult the MySQL documentation or support resources for further troubleshooting steps.\n\nNote that the exact steps to resolve the issue may vary depending on your specific environment and configuration.
原文地址: https://www.cveoy.top/t/topic/pZw7 著作权归作者所有。请勿转载和采集!