1, to MySQL Download Mysql5.7.18-win64.zip (currently the latest version), and unzip the website.
Https://dev.mysql.com/downloads/windows/installer/5.7.html
2, extracted to the Windows drive letter, here I put in the E-disk MySQL folder, (D:\mysql\mysql-5.7.18-winx64);
3, in the D:\mysql\mysql-5.7.18-winx64 directory to create a new My.ini configuration file and Data folder to store the information, the configuration file contents are as follows:
[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
[Mysqld]
#设置3306端口
Port = 3306
# set up the MySQL installation directory
Basedir=d:/mysql/mysql-5.7.18-winx64
# Set up a storage directory for MySQL database data
Datadir=d:/mysql/mysql-5.7.18-winx64/data
# Maximum number of connections allowed
max_connections=200
# 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
4, then open the CMD, run as Administrator, enter into the bin directory, D:\mysql\mysql-5.7.18-winx64\bin>, and then initialize the operation, or will error, command as follows (command in the bin run): mysqld-- Initialize; then install with Mysqld-install and then start the service using net start MySQL;
5, the initialization is successful, but also in the data directory to generate a xxx.err file, this xxx is the name of the computer. This will record the random login password generated by MySQL for the root user;
6, in the bin with mysql-uroot-p login, password for the xxx.err in the random password;
7, after the login to change the root password, set Password=password (' NewPassword '), the password has uppercase and lowercase letters plus numbers, otherwise the password is too simple to error;
This article is from the "Linux" blog, so be sure to keep this source http://clarence.blog.51cto.com/8161461/1940949
Win7 Install mysql-5.7.18