Mysql5.7 installation tutorial (windows), mysql5.7 tutorial

Source: Internet
Author: User

Mysql5.7 installation tutorial (windows), mysql5.7 tutorial

How to install and configure mysql5.7

Download

Mysql 5.7.msi

Install

Double-click mysql. msi and follow the prompts to install it.

Precautions after installation)

Set the mysql environment variables (so that mysql can be called in any path in cmd)

1. Right-click the computer and click Properties.

2. select Advanced System variable settings and click environment variables.

3. Select PATH in system variables and click Edit.

4. Add "; C: \ Program Files \ MySQL Server 5.7", (C: \ Program Files \ MySQL Server 5.7 is the root directory of mysql installation, if there is a change during installation, enter the path after the change. Note that there is one before the root directory.) Click OK and then click OK to exit.

Initialize mysql

1. Go to the root path after mysql5.7 is installed (the default installation path is C: \ Program Files \ MySQL Server 5.7. If you have changed it during installation, the path you have changed .)

2. the mysql root directory structure is as follows:

3. Copy A my-default.ini under the current directory and rename it my. ini. The directory structure is

4. Open the my. ini file in notepad or another text editor, add "skip_grant_tables" at the end of the file content, and save the file.

5. Run cmd to enter the bin folder in the root directory.

Press the windows Home Key (a key on the left of the alt key in the lower left corner of the keyboard, similar to "Tian") + R, Enter cmd, and press ENTER

In the displayed window, enter "cd C: \ Program Files \ MySQL Server 5.7 ** bin **" and press Enter.

Enter "mysqld -- initialize" and press Enter. The data folder is generated under the root directory. At this time, mysql Initialization is complete. The root directory structure after Initialization is as follows:

Register mysql as a system service

1. Press the windows Home Key + R (a key on the left of the alt key in the lower left corner of the keyboard, similar to "Tian"), Enter cmd, and press Enter.

2. In the displayed window, enter "cd C: \ Program Files \ MySQL Server 5.7 ** bin **" and press Enter.

3. Enter "mysqld -- install" and press Enter. For example, if you have registered a service before, you will be prompted that the service already exists)

4. Now you can use "net start mysql" in cmd to start the mysql service and use "net stop mysql" to stop the service. (Mysql environment variables need to be set)

Change the mysql initialization Password

1. Add "skip_grant_table" to the end of my. ini file in the root directory, save and exit (you have already done it before, you can skip it ).

2. Open cmd, enter the following commands in sequence, and press enter (when the password prompt is displayed, press enter directly)

mysql -u root -p;use mysql;update user set authentication_string=password("123456") where user="root";flush privileges;update user set password_expired="N" where user="root";

3. Delete the "skip_grant_table" added at the end of my. ini file in the root directory, save the file, and restart mysql. Then you can log on with the new password.

The above steps are executed in sequence, the mysql-5.7 can be successfully installed.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.