MySQL problem logging--can ' t connect to MySQL server on localhost (10061) workaround

Source: Internet
Author: User
Tags mysql version uuid

This article MySQL installation environment is Win7 64 bit, MySQL version is MySQL5.7

Problem Description: Enter Mysql-u root-p on the command line to log in to MySQL and return "Can ' t connect to MySQL server on localhost (10061)" Error

Problem reason: In a Google, Baidu, found that the problem is that MySQL did not start.

WORKAROUND: 1. Add MySQL to the services of Windows. Switch to the Bin folder in the MySQL installation directory, run "Mysqld--install" on the command line

1 5.7 mysqld--install 2 Service successfully installed.

If you successfully start MSYQL using "net start MySQL", you do not need to perform the following steps

2. Initialize the MySQL database and enter "Mysqld--initialize--user=root--console". The following red text is the root password after initialization

C:\Program Files\mysql\mysql Server5.7\bin>mysqld--initialize--user=root--Console .-Ten-29T01: *: -.309833Z0[Warning] TIMESTAMP withImplicitDEFAULT value isdeprecated. please use--explicit_defaults_for_timestamp server Option (see documentation forMore details). .-Ten-29T01: *: $.659968Z0[Warning] Innodb:new log files created, lsn=45790 .-Ten-29T01: *: -.154996Z0[Warning] innodb:creating foreign key constraintsystem tables. .-Ten-29T01: *: -.362008Z0[Warning] No existing UUID have been found, so we assume that This  isThe first time that Thisserver has been started. GeneratingaNewuuid:043563f4-9d78-11e6-a8c8-606dc79c383c. .-Ten-29T01: *: -.388009Z0[Warning] Gtid table isNot ready to be used. Table'mysql.gtid_executed'cannot be opened. .-Ten-29T01: *: -.401010Z1[Note] A Temporary password isGenerated for[Email protected]:u). IG. GD.7HW

3. Use "net start MySQL" to start msyql successfully at this time

4. Use the generated password to log in to MySQL and change the password via "Set Password=password (' 123456 ')". The root password is set to 123456 here

set password=password ('123456'01 Warning ( 0.00 sec)

MySQL problem logging--can ' t connect to MySQL server on localhost (10061) workaround

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.