Slow connection to local MySQL in Windows 7/8

Source: Internet
Author: User

This article introduces how to resolve the slow connection to local MySQL in Windows 7/8. For more information, see the reference.

After setting up the PHP environment in Windows 7 last time, I went online to find some PHP source code for debugging. These PHP can run perfectly, and some of them need to install the mysql database, I downloaded and installed mysql-5.1.51 and phpMyAdmin-3.3.7. However, every time the installation program reaches the configuration database step, it cannot connect to the mysql database. I can make sure that the database username and password are correct, and this is also the case for whatever program to install.

I checked mysql and found no problem. My mysql server uses the local address localhost, default root and empty password, and phpMyAdmin can be used to connect to the mysql database, baidu has not found the answer for many times. If you want to test the machine again today, you can enter the IP address 127.0.0.1 when you think of the local address. This was just a try, but you did not expect the installation to be successful.

We know that localhost and 127.0.0.1 are both local addresses. If you enter localhost, the system will automatically resolve it to 127.0.0.1, and my phpMyAdmin will also be opened with the address localhost, it indicates that the localhost has been resolved to 127.0.0.1, but you do not know why you cannot use the localhost address to connect to the mysql database.

Because the default database address localhost installed by most PHP programs is changed to 127.0.0.1 every time, it is a little troublesome. It is easy to understand the principle, we can modify the HOSTS file to achieve our goal. First, use NotePad to open the HOSTS file "C: \ WINDOWS \ system32 \ drivers \ etc \ hosts". Then, add "127.0.0.1 localhost" to it and save the solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.