MySQL installation and initialization (WINDOWS7)

Source: Internet
Author: User

0, Learning Python on Windows, today to the database programming, need to install MySQL.


1, download Mysql-5.7.13-winx64.zip, extract to D:\Program files\ (recorded as Directory m)

Create the My.ini file (overwrite My-default.ini) in the M directory with the contents of

[Mysql]default-character-set=utf8 [mysqld]port = 3306 Basedir=d:\program files\mysql-5.7.13-winx64datadir=d:\ Program Files\mysql-5.7.13-winx64\datamax_connections=200character-set-server=utf8default-storage-engine=innodb


2, CMD Administrator boot, CD to m\bin\

D:\Program Files\mysql-5.7.13-winx64\bin>mysqld--initialize

A, This command will generate the Data folder (Initialize) in D:\Program files\mysql-5.7.13-winx64\

b, do not initialize, you create an empty data folder, there will be an error:

The MySQL service is starting. The MySQL service could not be started. The service did not report any errors. Please type NET

Delete the Data folder, and then execute mysqld--initialize

C, using this command will generate the root user's random password

If the root user's password generated using--initialize-insecure is empty

D, what is the random password?

This is what the official document says:

the server creates a  ' root ' @ ' localhost '   Superuser account. the server ' s action with respect to apassword  for this account depends on how you invoke it: with -- initialize but not --initialize-insecure, the server generates a  random password,marks it as expired, and writes a message  displaying the password:[warning] a temporary password is generated  For [email protected]: itag*afrh5ej 

That is , the Xxx.err file in the D:\Program Files\mysql-5.7.13-winx64\data folder has the root user's password in the form "A temporary password is generated for [email protected]: Itag*afrh5ej"in the rear 12 bits.

E, if you do not lose the password will be error:

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using password:n O)


3, after the initial installation services:

D:\Program files\mysql-5.7.13-winx64\bin>mysqld Install


4. After success, start MySQL

D:\Program files\mysql-5.7.13-winx64\bin>net start MySQL


5. Log in to MySQL:

D:\Program files\mysql-5.7.13-winx64\bin>mysql-uroot-p

You will be prompted to enter your password:

Enter the password in Xxx.err: (Mine is PDK<HW<=,7.G)


6. Change Password After login:

mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');


Conclusion: After the error, you find the official ( http://dev.mysql.com/doc/refman/5.7/en/ ) document See



This article is from the "A-filled blog" blog, please be sure to keep this source http://laizetian.blog.51cto.com/10728827/1786180

MySQL installation and initialization (WINDOWS7)

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.