Then go to the next few articles to see the installation of MySQL under Windows. I here is Windows7 64 bit, the installation process still encountered some pits, recorded here.
First, download the installation package
Open MySQL official website download page: http://dev.mysql.com/downloads/mysql/
Select the appropriate version and platform
Here the choice is 5.7.13 version 64-bit compression package, the file is larger than 310M.
Click Download to enter the real download page, found to login to download, to be careful will find below there is no thanks, just start my download. Just click on this link to do it.
Download extract to the appropriate directory, here unified in C:\wamp-all
After decompression according to their favorite folder changed to name Mysql-5.7.13, all of the MySQL files are in this directory: C:\wamp-all\mysql-5.7.13
Second, MySQL configuration
Open the folder just unpacked C:\wamp-all\mysql-5.7.13, found that there is a My-default.ini configuration file, this is the default configuration file, copy a change of their name for My.ini
Edit My.ini to configure the following basic information:
[mysql]# set MySQL client default character set default-character-set=utf8[mysqld]# set 3306 ports port = 3306# Set the installation directory for MySQL Basedir=c:\wamp-all\ mysql-5.7.13# set the data storage directory for the MySQL database datadir=c:\wamp-all\sqldata# the maximum number of connections allowed max_connections=20# The character set used by the service side defaults to the 8-bit encoded latin1 character set character-set-server=utf8# the default storage engine that will be used when creating a new table Default-storage-engine=innodb
Iii. install and start MySQL
Open cmd command line tool with Administrator, CD to extract file bin directory: C:\wamp-all\mysql-5.7.13\bin
Enter mysqld install to run, the installation will be successful.
Input net start MySQL start MySQL (or open Windows service to start MySQL manually)
Startup found in cmd, no boot.
Search on the Internet The discovery is 5.7 version has this problem, to manually initialize the data directory in the bin directory
CD to the bin directory before initializing
1. Mysqld--initialize-insecure automatically generate a password-free root user,
2. mysqld--initialize automatically generate root user with random password
Choose 1 Mysqld--initialize-insecure here
After initialization, run net start MySQL to successfully start MySQL.
Iv. entering the MySQL environment
1. Cmd to the bin directory to execute mysql-uroot (no password required),
2. Set a password for the user: mysqladmin-u root-p password, error when setting password: Access denied for user ' root ' @ ' localhost ' (using Password:yes)
is because the localhost root user is not authorized, a new user is created here, and then authorized to
Create user ' test ' @ ' localhost ' identified by ' your password ';
Grant all privileges on * * to [email protected] ' localhost ';
Run these two SQL statements and enter the password again with Test's identity
3. In the command line type: Mysql-utest-p Enter, and then enter the password you just set to enter.
If you want to exit the SQL environment and return to the normal CMD environment, enter exit return. Enter MySQL again to execute 3rd.
V. Execute SQL statements
show databases; You can see the default database
Use MySQL;
Show tables;
select * from user;
......
VI. Configuring environment variables
If you do not want the CD to the MySQL bin directory every time, you can configure the environment variables, the cmd command executes the mysql instruction will go to the environment variables to find the corresponding path.
Right-click My Computer, properties, advanced system settings, environment variable->path-> edit, will download the full path of the extracted MySQL bin directory inside: C:\wamp-all\mysql-5.7.13\bin; Multiple are separated by semicolons.
Reference Documentation:
1. http://dev.mysql.com/downloads/file/?id=463242
2. http://jingyan.baidu.com/article/597035521d5de28fc00740e6.html
3. http://bbs.csdn.net/topics/391851148//Resolve 5.7 Startup issues
4. Http://zhidao.baidu.com/link?url=J26PKMHhHv1fPpiPEwSCOSKMKhpdbgjOzwW6B6ZMk075FtzOE_nRcE982Zo_ Ititd5zqcal0izl7ewlhnpgm6w1ufunuceloyef-uvyvaws
Install MySQL notes under Windows