MySQL8.0.26 decompression version installation
1. Download the decompressed MySQL installation package
Download address: https://dev.mysql.com/downloads/mysql
2. Unzip the MySQL installation package
Unzip the data package in the installation directory (note: you can unzip it to your own defined directory as needed)
such as:D:\devenvironments\mysql\mysql-8.0.26
3. Configure my.ini file
Create a new configuration file in
D:\devenvironments\mysql\mysql-8.0.26
the (note that this is your own installation path) directory, the file name ismy.ini
, and then copy the following configuration code tomy.ini
(the path in the code should be changed to your own file storage path)
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=D:\devenvironments\mysql\mysql-8.0.26
# 设置mysql数据库的数据的存放目录
datadir=D:\devenvironments\mysql\mysql-8.0.26\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
4. Configure environment variables
1. Right click
我的电脑
-->属性
-->高级系统设置
-->高级
-->环境变量
2. Create a new variable in the system variable Variable
name:MYSQL_HOME
variable value:D:\devenvironments\mysql\mysql-8.0.26
(MySQL installation path)
3. Find the path variable and add variable value
%MYSQL_HOME%\bin
5. Initialize MySQL
Open the cmd command line tool as an administrator, enter the MySQL installation directory, execute
mysqld --initialize --console
(no need to close the command line tool), remember the initial password, so that you can log in and change the password later
6. Register/install MySQL service
Then enter
mysqld -install
7. Start the MySQL service
Then enter
net start mysql
8. Log in to MySQL and change the default account password
Then enter
mysql -u root -p
and press Enter, enter the initialization password just now
If the above description appears, it means that the MySQL login is successful
Enter
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
to modify the default password (customize the default password as needed)
Appears Query OK
to indicate that the MySQL default password has been successfully modified, just log in again