1. Prepare the .zip installation-free package of the database, download address
link: https://pan.baidu.com/s/1vI6W-F7XZ0iKuCMSBtUuhQ?pwd=r9p1
Extraction code: r9p1
2. Unzip to the location you want to install

3. Configure environment variables
Right click on this computer-> ;Properties->Advanced System Settings->Environment Variables



## is in the system variables Create a new MYSQL_HOME

The variable value here is the address after decompression of MYSQL
At the same time, find the path in the system variable, edit it, and add %MYSQL_HOME%\ bin

4. Create a new my.ini configuration file
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
max_connect_errors=10
max_connections=50
Copy after login
and place it in the installation directory
5. Enter mysqld --initialize-insecure in cmd (administrator)
If no error message appears (as shown below), it proves that there is no problem with the initialization of the data directory. At this time, check the MySQL directory The data directory has been generated.

6. Enter mysqld -install to install the MYSQL service

The service is installed successfully
7. Start and shut down services
net start mysql // 启动mysql服务
net stop mysql // 停止mysql服务
Copy after login
8. Modify account password and log in
mysqladmin -u youruser password yourpassword //修改默认账户密码
mysql -uyouruser -pyourpassword //登录mysql
Copy after login
The above is the detailed content of How to install MYSQL5.7.24 under Windows Server 2012. For more information, please follow other related articles on the PHP Chinese website!