Windows local mysql installation tutorial (step-by-step installation)

1 Download the installation package

Download URL:
https://dev.mysql.com/downloads/Choose
this
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

2 installation

Insert image description here
Write the MySQL configuration file and
create a new my.ini file in the unzipped directory.

Insert image description here
Copy the following text into my,ini file

[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录   ----------是你的文件路径-------------
basedir=D:\\mysql-8.0.26-winx64\\mysql-8.0.26-winx64
# 设置mysql数据库的数据的存放目录  ---------是你的文件路径data文件夹自行创建
#datadir=E:\\mysql\\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

Initialize the MySQL database.
Open the command prompt as an administrator
and switch to the bin directory.

Insert image description here
Execute the command in the bin directory under the MySQL directory:

mysqld --initialize --console

Insert image description here
My random password is: 2(eE8rwv#a(?
Install the mysql service and start it

mysqld --install mysql

Insert image description here
Start the mysql service

net start mysql

Insert image description here
Connect to MySQL

mysql -uroot -p

Enter the random password just now

Insert image description here

change Password

ALTER USER 'root'@'localhost' IDENTIFIED BY '111111';
Insert image description here
You can enter quit or exit to exit.
To log in, you can use mysql -uroot -p

Insert image description here

Guess you like

Origin blog.csdn.net/python113/article/details/132898130