Mysql 5.7.15 installation and configuration method graphic tutorial (windows), mysql5.7.15

Source: Internet
Author: User

Mysql 5.7.15 installation and configuration method graphic tutorial (windows), mysql5.7.15

Because I need to install MySQL, I will record the installation process as follows. While recording it myself, I hope to help anyone who has doubts.

1. Download Software

1. Go to the mysql official website, log on to your oracle account (no account of your own registered a), download Mysql-5.7.15,: http://dev.mysql.com/downloads/mysql/

2. Extract the downloaded file to the specified directory, the author decompress in D: \ mysql-5.7.15-winx64

Ii. Installation Process

1. First configure the environment variable path, configure D: \ mysql-5.7.15-winx64 \ bin to your own path, the specific again not detailed

2. Copy the my-default.ini in the extract path and change the name to my. ini, as shown in

3. open the file my. ini and add the following content:

[mysqld] basedir=D:\\mysql-5.7.15-winx64 datadir=D:\\mysql-5.7.15-winx64\\data port=3306 

SQL _mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION"

Basedir: the mysql decompression path.

Datadir: Subsequent initialization and other data will be stored in this directory (Note: do not create a new data folder in this directory, and an error will occur when I create a new data folder. follow the steps below, will be automatically created later .)
Port: indicates the port connecting to the database.
SQL _mode: indicates the SQL mode.

Iii. initialize database configuration information

1. Run the windows command line as an administrator. (Note: For windows and later versions, the Administrator must be used. Otherwise, subsequent operations may fail)

2. Enter the mysql extract Directory D: \ mysql-5.7.15-winx64 \ bin (Note: here you need to enter the bin directory, otherwise the subsequent operation will have an error)

3. Input: mysqld -- initialize -- user = mysql -- console. After the command is executed, the initial password of root is generated.

Write down the generated initialization password.

4. register the Mysql service. Run the command: mysqld -- install MySQL

If the message "Service successfully installed." is displayed, the mysql Service is successfully installed.

5. At this time, you can start the mysql service, net start mysql

The following error may occur:
A system error occurs. 2. The specified file cannot be found.

Error cause:As mentioned above, when running the installation service command: mysqld -- install MySQL, we did not enter the bin directory for installation.
Solution:Go to the bin directory, first remove the service, and run the command mysqld -- remove
Service successfully removed.
Reinstall the mysql service, run the command mysqld -- install, and then start the mysql service.
D: \ mysql-5.7.15-winx64> net start mysql
MySQL service is starting
MySQL service started successfully
The mysql service is started successfully.

4. log on to the database and change the password

In the my. ini file, add skip-grant-tables to the last line after [mysqld ].
Close the mysql service and restart it.
(Enter net stop mysql in the command line to close the MySQL service, and enter net start mysql to enable the MySQL Service)
Login: Enter mysql-u root-p and enter the Enter key. If the password is blank, press enter to log on to MySQL.

Select mysql database:

Query the mysql database user table, select * from user

In this case, the password field is named authentication_string. Some may be passwords, which are based on your query results.
Perform the update operation on the table user: update user set authentication_string = password ("123456") where user = "root"

Operation successful. Exit mysql
Delete the skip-grant-tables in the my. ini file and restart the mysql service. Log on to MySQL

Possible problems in the future:
After mysql is installed, the following message is always displayed no matter whether You run any command: You must reset your password using alter user statement before executing this statement.

When this problem occurs, you only need to run the following two commands under the command line mysql:

Alter user 'root' @ 'localhost' password expire never;

Flush privileges;


Note: The preceding two commands must be executed separately.

After the preceding two commands are completed, MySQL is fully installed.

See the graphic tutorial for installing and configuring mysql 5.7.14.

Highlights: mysql installation tutorials for different versions mysql5.7 installation tutorials for various versions mysql5.6 installation tutorials

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.