Mysql installation-free version configuration and password change tutorial, mysql installation version

Source: Internet
Author: User

Mysql installation-free version configuration and password change tutorial, mysql installation version

Step 1: Configure environment variables (My decompression path: G: \ mysql \ mysql-5.7.21-winx64)

MYSQL_HOME = the decompressed path

PATH = ;%MYSQL_HOME %\bin; 

The PATH variable is added based on the original one. Do not delete other settings.

Step 2 Add the my. ini file in the decompressed directory (if this file already exists, replace the content in it)

The file content is

[Client] port = 3306 default-character-set = utf8 [mysqld] port = 3306 character_set_server = utf8 # extract the directory basedir = G: \ mysql \ mysql-5.7.21-winx64 # extract the data directory under the data Directory datadir = G: \ mysql \ mysql-5.7.21-winx64 \ data SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES [WinMySQLAdmin] G: \ mysql \ mysql-5.7.21-winx64 \ bin \ mysqld.exe

Step 3: Run cmd as an administrator (Baidu), enter the bin folder in the decompression path, and execute the mysqld-install command, create a new data folder (NO content in it) under the decompression path)

Step 4: log on

Open cmd as an administrator and enter mysql-uroot-p. Press enter without a password (the default password is blank)

Step 5: change the password

First usenet stop mysql Stop the mysql service and add a section in the my. ini file.skip-grant-tables

Start the mysql service and modify the authentication_string field value of the root user in the user table in the mysql Data Source (originally the password field, and then changed it to authentication_string)

 

After the operation is successful, delete the skip-grant-tables in the my. ini file.

If an error occurs:

ERROR 1820 (HY000): You must reset your password using alter user statement before executing this statement.

Because the password has expired, you can set it like this

set password = password('mysql');use mysqlupdate user set password_lifetime = 0 where User='root';flush privileges;

Summary

The above is a simple tutorial on configuring and changing the password of mysql without installation. I hope it will be helpful to you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.