#What should I do if mysql cannot connect to localhost?
Solution to the problem that mysql cannot connect to localhost:
1. Check whether the firewall allows port 3306, and click Management Tools--Advanced Security Firewall-- Inbound Rules--Create a new rule.
2. Click on the port
3. Set the port number to 3306
4. Allow connection--write the name as you like. For example: allow inbound port 3306
##5. Then The administrator runs the command prompt (win R) cmd Start the database net start mysql and then try to connect! Recommended tutorial: "sql video tutorial"
The above is the detailed content of What should I do if mysql cannot connect to localhost?. For more information, please follow other related articles on the PHP Chinese website!