Windows installation Mysql5.7.10 Green Edition

Source: Internet
Author: User
Tags documentation

Today, when installing MySQL on Windows, I went to the official web site under the latest version of the Mysql5.7.10 green version, but before the online installation method is outdated, such as will be reported some common errors "[ERROR] Fatal Error:can ' t Open and Lock privilegetables:table ' mysql.user ' doesn ' t exist, after all, is open-source stuff, official documents compared to the whole, self-clothed AH. Here are the installation steps for my reference to the official documentation.

1. Unzip the downloaded MySQL installation package, copy the Mysql-default.ini, and rename it to Mysql.ini. When MySQL starts, it will look for files with the name Mysql.ini.

2. Edit the Mysql.ini, edit the Basedir and DataDir directories under [mysqld], if not added by yourself, where "#" is the meaning of the comment.

[mysqld] # set Basedir to your installation pathbasedir=e:\\mysql# set DataDir to the location of your data Directoryd Atadir=e:\\mydata\\data

Note that the path under Windows is to use "\ \".

For additional configuration options for MySQL, refer to: http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

3. Initialize the Data directory

Use the CD command to reach the bin directory, or add the folder path to the bin directory to the path in the environment variable.

Run any one of the following commands:

Bin\mysqld--initializebin\mysqld--initialize-insecure

The common denominator of these two commands is:

1. If the data directory does not exist, then create;

2. If there is data in the data directory, the following error will be generated:

[ERROR] --initialize specified but the data directory exists. Aborting.

Different points are:

The 1.mysqld--initialize command creates a ' root ' @ ' localhost ' super account and is assigned to a random password that can be seen in the MySQL error log file, and the general error log file is under the data folder named " Your hostname-pc.err "file, which has such a line" [Note] A temporary password is generated for [email protected]: WYOV/8XVPYCV ".

The 2.mysqld--initialize-insecure command also creates a ' root ' @ ' localhost ' super account, but the password is empty. Without the password, you can only log in with root, remote access is not possible.

4. Change the root password:

1. With the mysqld--initialize command to initialize the data, modify the password in the following manner:

Start the MySQL database using mysqld--console;

This indicates that the boot was successful:

     

Using another CMD window, log in Mysql:mysql-u root-p with the random password given above and execute: ALTER USER ' root ' @ ' localhost ' identified by ' 123456 ';

2. If you initialize data data with the MYSQLD--initialize-insecure command:

Start the database using Mysqld--console;

Using another CMD window, enter the following command:

mysql-u rootalter USER ' root ' @ ' localhost ' identified by ' New_password '  ; 

     

This completes the installation of the MySQL database Green Edition.

Reference Documentation:

1. Green version installation steps: http://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html

2. Initialize the Data directory: http://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html

3. Initialize root account password: http://dev.mysql.com/doc/refman/5.7/en/default-privileges.html

4. Password change: http://dev.mysql.com/doc/refman/5.7/en/alter-user.html

5. Reset Password: http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

Windows installation Mysql5.7.10 Green Edition

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.