1. Preparation
Download the latest GA version of mysql-5.7.18. Download address: https://dev.mysql.com/downloads/mysql/, extract it to any drive letter, and the path should not contain Chinese.
2. Installation configuration
2.1, prepare the configuration file
my.ini
[mysql]
# Set the default character set of the mysql client
default-character-set=utf8
[mysqld]
skip-grant-tables
#Set 3306 port
port = 3306
# Set the installation directory of mysql
basedir=D:\SQL\mysql-5.7.18-winx64
# Set the storage directory for the data of the mysql database
datadir=D:\SQL\mysql-5.7.18-winx64\data
# maximum number of connections allowed
max_connections=200
# The character set used by the server defaults to the 8-bit encoded latin1 character set
character-set-server=utf8
# The default storage engine that will be used when creating new tables
default-storage-engine=INNODB
There is a lot of content in this file on the Internet, or you can use the configuration file in the lower version.
2.2, configuration service
Open the cmd command window as an administrator, switch to the bin of the unzipped Mysql folder, and enter: mysqld --initialize-insecure --user=mysql This command is to initialize data and users. After executing the above command, MySQL will Create a data folder by yourself, and build a default database. The login user name is root and the password is empty .
Then enter mysqld install and press Enter to register to the system service, then enter net start mysql to start the service, OK is successful.