1)mysql download
Address: https://dev.mysql.com/downloads/mysql/
2) all the way next installation, after installing the file directory as follows (excluding Data folder, My.ini file)
3) new file My.ini, note that the format is ANSI, the contents of the file are as follows:
[MySQL]
# Set the MySQL client default character set
#default-set-server=utf8
[Mysqld]
#设置3306端口
Port = 3306
# set up the MySQL installation directory
basedir=d:\mysql\mysqlserver5.7
# Set up a storage directory for MySQL database data
Datadir=d:\mysql\mysqlserver5.7\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
#skip-grant-tables
#注: Basedir, DataDir change to their own installation path
4) Installation Services
Open CMD window as Administrator, CD to the bin directory of the MySQL installation path
Input command: Mysqld-install
5)Add a sentence at the end of the My.ini file: Skip-grant-tables, save
6) Open CMD window, CD to MySQL installation path in bin directory
Start service: net start MySQL
Login: Mysql-u root-p return and return
To modify the password execution statement:
Use MySQL
updatemysql.user set authentication_string=PASSWORD(‘password‘) whereUser=‘root‘;
7) Close service: net stop MySQL, delete my.ini skip-grant-tables statement
8) start the service: net start MySQL login: mysql-u-root-p Enter the password just entered, login success
1. Startup failure after installation
Error Cause: My.ini file format is incorrect
Correct format: ANSI
2. Change root password, failed
Error reason: There is a problem with the statement
正确语句:updatemysql.user set authentication_string=PASSWORD(‘password‘) whereUser=‘root‘;
Installing MySQL and the pits encountered