Mysql5.7 Windows free install version initialization configuration

Source: Internet
Author: User

One, download Mysql-5.7.22-winx64.zip compressed files from the official website, extract to the custom directory.

Second, add the bin directory under the MySQL installation directory to the system PATH environment variable.

Third, configure the My.ini file, placed in the MySQL installation directory. The contents of the file are as follows:

[client]port=3306[mysqld]basedir=d://programfiles//mysql-5.7.22-winx64datadir=d://programfiles// Mysql-5.7.22-winx64//dataport=3306character-set-server=utf8[mysql]default-character-set=utf8

Description: Basedir is the MySQL installation directory, datadir the location for the database file, both paths must exist.

Iv. implementing MySQL--install MySQL

Description: This command creates a service named MySQL, service name customization if you need to remove the service, you can delete it by mysqld--remove MySQL or sc delete mysql.

V. Execute initialization command

Mysqld--initialize--console

or mysqld--initialize-insecure.

Description: The difference between the two is:

The former automatically randomly generates the password for the root admin account,--console the output of the command to the console (in order to view the password)

The latter will use the default empty string as the password.

Vi. start the MySQL service

Command line execution net start MySQL

Close service net stop MySQL

Where MySQL is the service name of the above customization;

Vii. Modifying a custom password

Execute command mysql-u root-p (if the password is empty, you can also use mysql-u root--skip-password)

And then enter the password to successfully connect MySQL;

Three ways to change your password:

1. Alter user ' root ' @ ' localhost ' identified by ' new_password ';

2. Set password for [email protected] = password (' new_password ');

3, use MySQL;

Update user set Authentication_string=password (' New_password ') where user= ' root ';

Flush privileges;

Viii. Other Notes

In the execution of Mysqld--initialize, if the data folder does not exist, the data folder already has the old data, will be an error.

  

Mysql5.7 Windows free install version initialization configuration

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.