Windows MySQL 5.7.10 can not log on the issue

Source: Internet
Author: User
Tags win32

After the installation is complete, unable to log on to MySQL, it is said that the new installation by default is the root user login, and the password is empty, so you can directly into the, but there are the following problems

F:\mysql-5.7.10-win32\mysql-5.7.10-win32\bin>mysql-u Root

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

After I surf the internet to find the new MySQL default password, after I try to add a skip-grant-tables in the configuration file, reboot can go in, so it must be the password problem

So I began to search for a variety of solutions, after some effort, finally found a solution

Mysql>delete from Mysql.user where user= ' root ' and host= ' localhost ';

Query OK, 1 row affected (0.01 sec)

Mysql> select User,host from Mysql.user;

+-----------+----------+

|user |host |

+-----------+----------+

|mysql.sys |localhost |

+-----------+----------+

1 row in Set (0.00 sec)

Mysql>flush privileges;

Query ok,0 Rows Affected (0.00 sec)

Mysql>grant all on * * to ' root ' @ ' localhost ' identified by ' dingwei351 ';

Query ok,0 rows affected, 1 Warning (0.00 sec)

Mysql>select user,host from Mysql.user;

+----------+-----------+

|user |host |

+----------+-----------+

|mysql.sys |localhost |

|root |localhost |

+----------+-----------+

2 rows in Set (0.01 sec)

But it's not going to work, you'll find a situation with the following command

Mysql>select * from Mysql.user;

Grant shows that the N--mysql permission architecture system (which should be said) is off, so you should do the following

Mysql>grant all on * * to ' root ' @ ' localhost ' identified by ' dingwei351 ' with GRANT option;

Query ok,0 rows Affected (0.01 sec)

Quit MySQL, skip-grant-tables, and then restart MySQL. It's time to log in again.

F:\mysql-5.7.10-win32\mysql-5.7.10-win32\bin>mysql-u root-p

Enter password:**********

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 2

Server version:5.7.10 MySQL Community server<gpl>

Copyright<c>2000,2015,oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Windows MySQL 5.7.10 can not log on the issue

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.