MySQL error: Can tconnecttoMySQLserver (10060)

Source: Internet
Author: User
Can

Can

When you remotely connect to the MySQL database, You Can't connect to MySQL server (10060). We Can start from the following aspects to find out the cause of the error:

1. The network is disconnected.

Check whether the ping is successful.

2. Firewall settings.

Whether the firewall has spared the mysql process and blocked port 3306 of mysql.

3. mysql account settings.

Whether the mysql account cannot be remotely connected. If the connection fails, try the following methods:

Mysql-u root-p // log on to MySQL

Mysql> grant all privileges on *. * TO 'root' @ '%' with grant option; // any remote host can access the database.

Mysql> flush privileges; // you need to enter the command to make the modification take effect.

Mysql> EXIT // EXIT

You can also modify the table to remotely:

Mysql-u root-p

Mysql> use mysql;

Mysql> update user set host = '%' where user = 'root ';

Mysql> select host, user from user;

,

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.