MySQL can be connected using localhost, but cannot be connected using an IP address.

Source: Internet
Author: User

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!

Related Article

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.