Detailed explanation of MySQL installation operation steps under Windows environment (zip format)

Installation environment: Window10 Home Edition, 64-bit

Database: MySQL 64 bit

Installation method: compressed package installation

 

1. Download

1. Open the official website, select the win64.zip installation package, and click "Download"

Official website address: https://dev.mysql.com/downloads/mysql

2、点击“No thanks,just start my download”

 

Two, installation

1. Unzip the downloaded mysql installation package and unzip it to the directory where you want to store it

2. The file structure diagram after decompression is as follows

3. Create a my.ini file in the decompressed root directory

4. Open the my.ini file and enter the following content in the my.ini file.

Note: basedir is the database path, datadir is the data path, the port number of mysql is 3306 by default

# 数据库服务端配置项
[mysqld]
# 数据库路径
basedir=D:\\software\\mysql\\mysql-8.0.19-winx64
# 数据路径
datadir=D:\\software\\mysql\\mysql-8.0.19-winx64\\data
# 端口号
port=3306
# 默认字符集
character-set-server=utf8mb4
# 存储引擎
default-storage-engine=INNODB
# 客户端配置项
[mysql]
# 默认字符集
default-character-set=utf8mb4
# 连接客户端配置项
[client]
default-character-set=utf8mb4

5. Open the cmd terminal window as an administrator, enter the bin directory under the mysql installation path, and enter the command "mysqld --initialize-insecure" in the cmd window. After execution, it will be automatically created in the mysql root directory A data folder.

6. Continue to enter the command in the bin directory under the mysql installation path: "mysqld -initialize -console" and press Enter to complete mysql initialization.

7. Continue to enter the command: "mysqld -install" in the bin directory under the mysql installation path and press Enter to complete the installation of the MySQL service.

8. Continue to enter the command in the bin directory under the mysql installation path: "net start mysql" and press Enter to start the database service.

9. Continue to enter the command in the bin directory under the mysql installation path: "mysql -u root -p", enter the password, and press the Enter key. If the following screen appears, it means that MySQL has successfully logged in.

Note: The MySQL installed for the first time has no password, just press Enter to log in

 

Three, environment variable configuration

1. Right-click My Computer on the computer desktop—>Properties—>Advanced System Settings—>Environment Variables—>System Variables

New variable name: MYSQL_HOME

Variable value: D:\software\mysql\mysql-8.0.19-winx64

(Note: The variable value is your mysql installation directory, which is the upper level directory of the bin folder)

2. Open Path, edit environment variables, and add %MYSQL_HOME%\bin

3. Open the cmd window and directly enter: mysql -u root -p, enter password, and press Enter. If the following screen appears, it means that MySQL has successfully logged in.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_43184774/article/details/106020174