The whole process of configuring MySQL 5.7 under Windows

Source: Internet
Author: User

This is a set of several times in the installation of the summary of experience, including many kinds of problems encountered, looked up a lot of information, hereby summarized.
Download MySQL's Zip from official website (Install-free)
Unzip the mysql-5.7.11-winx64.zip to its own specified path. Example: E:\mysql\mysql-5.7.11-winx64
Opening a directory will see several folders:

Remove My-default.ini All and configure the following information:
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
Skip-grant-tables
port=3306
Character_set_server=utf8
#解压目录
Basedir=e:\mysql\mysql-5.7.11-winx64 (note the location to be changed to its own decompression path)
#解压目录下data目录
Datadir=e:\mysql\mysql-5.7.11-winx64\data
Sql_mode=no_engine_substitution,strict_trans_tables
[Winmysqladmin]
E:\mysql\mysql-5.7.11-winx64\bin\mysqld.exe

Saved and renamed My.ini the first step to get it done

Second, Tim Initialize MySQL
In the extracted directory E:\mysql\mysql-5.7.11-winx64 found: The Data folder is missing, because MySQL from the 5.7 version of the need to initialize their own generation.
Now let's initialize MySQL, open cmd, and come to the bin path: e:\mysql\mysql-5.7.11-winx64\bin> mysqld–initialize
After this command, the data file is generated

Iii. start the installation of MySQL
e:\mysql\mysql-5.7.11-winx64\bin> mysqld Install
Will prompt success (if install denial, to ensure that your cmd is opened by the Administrator yo)
Then start the service to check if MySQL is installed successfully.
E:\mysql\mysql-5.7.11-winx64\bin>net start MySQL
If it does, the startup fails: Prove your My.ini file configuration is problematic, recheck,
Reinstall: e:\mysql\mysql-5.7.11-winx64\bin> mysqld Remove and then
e:\mysql\mysql-5.7.11-winx64\bin> mysqld Install
Start again, if the first successful, you can go directly to the next step.
Four, change the MySQL password. (available in two most effective ways)
(i) The first method (recommended)
1, then above, after starting the service, E:\mysql\mysql-5.7.11-winx64\bin>mysql-u root-p
"Access denied for user ' root ' @ ' localhost ' (using Password:yes)" will be prompted to deny login. otherwise log in.
2, do not worry, the next first net stop MySQL (stop service), skip his permission table check the method is: E:\mysql\mysql-5.7.11-winx64\bin>mysqld–skip-grant-tables
3, re-open a cmd,bin directory, enter the MySQL return, the mysql> prompt appears. Input use MySQL;
4. Change the password
Update Mysql.user Set Authentication_string=password (' 123qaz ') where user= ' root ' and Host = ' localhost ';
5. Refresh:mysql> flush Privileges;
6, quit the system and then enter the cancellation. Root 123qaz can log in.
But when I was faking it, the new problem was, Mysql-u root-p–>.
Password:123qaz, after doing database and table operation, remind me to reset password.
7. Reset Password:
Mysql>set password for ' root ' @ ' localhost ' =password (' 123456 ');Note that the password is now changed to 123456. The installation is complete.
(ii), the second method
1, or skip permission checks, but under My.ini under [mysqld] Add a line skip-grant-tables
2, MySQL restart, you can directly use Mysql-u root-p enter (at this time the password is empty)
3. Old step: Update Mysql.user set Authentication_string=password (' 123qaz ') where user= ' root ' and Host = ' localhost '; – "Flush privileges;–" quit;
4.my.ini file Restore (delete skip-grant-tables this line), restart MySQL
5, Mysql-u root-p ' 123qaz ' entered the
6, Mysql>set PASSWORD = PASSWORD (' 123456 '); Set a new password

 以上就是mysql的配置全过程。希望可以帮到大家。

The whole process of configuring MySQL 5.7 under Windows

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.