Can t connect to MySQL Server FAQ

Source: Internet
Author: User
Tags mysql tutorial

When connecting to the database tutorial show can ' t connect to MySQL Server (10060), Basic can follow the following ideas for troubleshooting:

1. The network is impassability.

Check to be able to ping.

2. Firewall settings.

Whether the firewall let go of the MySQL tutorial process, whether or not to block the MySQL 3306 port.

3. mysql account setup.

Whether the MySQL account does not allow remote connections. If you cannot connect, try the following methods:

Mysql-u root-p//login MySQL
Mysql> grant all privileges in *.* to ' root ' @ '% ' with GRANT OPTION; Database is accessible to any remote host
mysql> FLUSH privileges; You need to enter a secondary command to make the changes take effect
Mysql> Exit//exit

You can also implement a remote by modifying the table:

Mysql-u root-p

mysql> use MySQL;
mysql> Update user Set host = '% ' where user = ' root ';
Mysql> Select Host, user from user;

Can ' t connect to the MySQL server on ' localhost '
Error Number: 2003

Problem Analysis:

Unable to connect to the MySQL server, as possible:

1, the MySQL service does not start, generally in the case of the exception of MySQL can not start, such as no available disk space, My.ini mysql basedir path set error, etc.

2, the MySQL server resource is tight, causes cannot connect.


Workaround:

1, if you are a virtual host user (buy space), then contact space to check whether MySQL normal startup, and confirm MySQL configuration information (whether for localhost);

2, if you are a stand-alone host user (with administrative host permissions), then follow the steps below to check:

1 Check whether the MySQL service is started.

Windows host, right click on My Computer, click Manage, find the MySQL service in the service and application to see if it is in a started state.


Can ' t connect to MySQL server on ' localhost ' (10061) solution


Today, the MySQL database copy to another computer, the results are not even, reported "Can" T connect to the MySQL server on ' localhost ' (10061) "Error
To search online, found an article is very good, both methods can solve this problem
1, delete My.ini (under C:windows), rerun Winmysqladmin, request to enter user name and password, solve problem!
2, look at the Hosts file localhost is not pointing 127.0.0.1
If the MySQL service is not started, you can run net start MySQL.
Some related commands:
Mysqld-nt--install #启动Mysql
MySQL #运行Mysql
Mysql-h Ipaddress-u Username-p

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.