MySQL initial password settings under Windows

Source: Internet
Author: User
Tags safe mode

Reprinted from: http://blog.csdn.net/ofreelander/article/details/50802780

1.my-default.ini renamed My.ini

Copy the My-default.ini under the extracted directory and change the name to My.ini.

2. Open the Windows environment variable settings, new variable name mysql_home, the variable value is the MYSQL installation directory path, the environment variable is added in the path variable;%mysql_home%\bin;

3. Several commands

Installing the MySQL service: mysqld--install
Startup: Net start MySQL
Stop: net stop MySQL
Uninstall: SC Delete mysql,mysqld-remove

Command-line window must be opened in Administrator mode, to%mysql_home%\bin; in this directory,

A. Installation Services: Mysqld--install.

B. Start the service net start MySQL

(There may be a problem, the MySQL service is starting.) The mSQL service could not be started. The service did not report any errors. Please type NET helpmsg 3534 for more help.

Delete the Data folder and initialize the data directory with Mysqld--initialize. Delete the data, the Task Manager to open the kill mysqld process, the other start or shut down the service when the failure of the same practice. )

When successfully entering the service, use

Mysql-u Root-p Enter

Enter password

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

Close Service net stop MySQL

Open with Safe mode, mysqld--skip-grant-tables

At this point, the cursor will always blink. Note, do not move, open another command-line window.

4. The same operation as before came to the bin directory,

Login Mysql-u Root-p

Password is empty, direct carriage return;

We can go in.

And then

Use MySQL;

(Perhaps the previous version of the password header is password,5.7.11 is authentication_string, you can select * from user, view)

(old version) update user set Password=password ("123456") where user= "root";

(5.7.11) Update user set Authentication_string=password ("123456") where user= "root";

Finally, flush the privileges; it's OK.

5. Last login and try.

Just start to fail, is the English mysqld process is still open, kill off on the line.

Finally, the root password was successfully modified.

MySQL initial password settings under Windows

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.