Home>Article>Database> What should I do if MySql cannot connect to the local address localhost?

What should I do if MySql cannot connect to the local address localhost?

藏色散人
藏色散人 Original
2020-07-17 10:54:10 19753browse

Solution to the problem that mysql cannot connect to localhost: 1. Check whether the IP address can be pinged; 2. Check whether the firewall allows port 3306. If not, set the port number to 3306; 3. Start the database Just run the command "net start mysql" to try to connect.

What should I do if MySql cannot connect to the local address localhost?

Recommendation: "mysql tutorial"

First method: Check whether the IP address can be pinged, if so Look at the second one

The second one: check whether the firewall allows port 3306, management tools--Advanced Security Firewall--inbound rules--new rule


Click on the port


Set the port number to 3306


Allow Connection - write whatever name you want, for example: allow inbound port 3306


Then the administrator runs the command prompt (win R) cmd

Start database net start mysql Then try to connect!

The above is the detailed content of What should I do if MySql cannot connect to the local address localhost?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn