MySQL8.0.26 installation super detailed tutorial [super detailed]

Download MySQL
official website: https://dev.mysql.com/
https://dev.mysql.com/downloads/mysql/8.0.html

insert image description here
Select the corresponding system version
insert image description here
Click No thanks, just start my download to download
insert image description here
and decompress the compressed package and open the folder to create my.ini (right-click in the blank to create a text document, change the suffix name to ini, the system is hidden by default, In the computer menu bar, select View and check the file extension) because MySQL8.0 does not have a my.ini file
insert image description here

insert image description here
Copy the following files into the my.ini file

[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录   ----------是你的文件路径-------------
basedir=D:\mysql-8.0.26\mysql
# 设置mysql数据库的数据的存放目录  ---------是你的文件路径data文件夹自行创建
datadir=D:\mysql-8.0.26\mysql\data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8mb4

Open command prompt as administrator
insert image description here

Switch to the bin directory
insert image description here

enter

mysqld --initialize --console

`Remember random password mine is: .zYKQ4#?.p#2
insert image description here

install mysql and start

mysqld --install mysql

Successful installation
14a358def1acb727c20a3.png)

Start MySQL and enter the following command

net start mysql

The startup is successful
insert image description here
. Log in to MySQL to change the password.
Enter the command to connect to MySQL.

mysql -uroot -p

insert image description here
change password command

ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

The modification is successful.
insert image description here
Enter quit or exit to log out of MySQL .
insert image description here

MySQL environment variable configuration

This Computer->Properties->Advanced System Settings->Environment Variables
Or directly search for environment variables in the search box->Click Environment Variables
insert image description here
to create a new one in the system variables
Variable name: MYSQL_HOME
Variable value: your own MySQL installation directory
insert image description here
variable value is yours MySQL installation path
insert image description here
insert image description here
Then find the Path system variable -> Edit
insert image description here
and add the system variable just created above.
Here is to the bin directory

%MYSQL_HOME%\bin

insert image description here
After the creation is complete, make sure to save the variable,
so that MySQL is installed.

This step can be configured or not configured

Configure the MySQL startup service to manually make the computer boot faster
. Right-click this computer -> Manage
insert image description here
to see if MySQL is started
insert image description here

Guess you like

Origin blog.csdn.net/m0_46590717/article/details/120092406
Recommended