MySQL5.7.35 installation and configuration tutorial [super detailed installation tutorial]

MySQL5.7.35 installation tutorial

Download tool
Official website download and download
Baidu network disk extraction
Link: https://pan.baidu.com/s/1BOaGKmZynM5q8WfPhqi3GA
Extraction code: 1024
Select the version you need in the picture below. The second download
insert image description here
method is as shown in the figure below . Insert image description here
insert image description here

After the download is complete, unzip the toolkit. I unzip it on the D drive
insert image description here
. After unzipping, I will create a new my.ini file in it
(if you don't know how to create a my.ini file, please see) Right-click New Text Document
insert image description here
to create a text document and then re-create it. Name the suffix of the text document to ini as shown in the figure
insert image description here
, and then rename the newly created text document to my.ini
insert image description here

Edit the my.ini file and copy the following code into it . Remember to change the path of [basedir] and [datadir] to your own installation path.

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

After completion, start the installation of MySQL.
Open the command prompt and open it as an administrator.
insert image description here
After opening, go to your MySQL bin directory and
insert image description here
then execute the installation command to install MySQL and enter the code.

mysqld --install


The following figure shows that the installation is successful.
insert image description here
The next step is to print the MySQL password information and enter the code.

mysqld --initialize --console

Write down the initial password of your database and then log in to change the password.
insert image description here
Start the MySQL server and enter

net start mysql

If it appears, MySQL starts successfully.
insert image description here
Log in to the MySQL server and enter

mysql -u root -p

Enter the password and click Enter to log in. If it appears, there is an error in your password input. If the
insert image description here
input is successful, the following picture will appear.
insert image description here
After the login is successful, change the password and enter the root as your new password. You can change it to other

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

Password reset complete!
insert image description here
MySQL is installed, exit MySQL and enter exit to
insert image description here
configure MySQL environment variables
. Open environment variables and
insert image description here
click environment variables to create a
insert image description here
new system environment variable
insert image description here
. The variable name is: MYSQL_HOME
variable value is your MySQL installation path.
Click OK
insert image description here
. Find the path variable and click Edit to
insert image description here
create a new environment
variable It is: %MYSQL_HOME%\bin
insert image description here
and then confirm it all the time, so that the configuration of the environment variables is completed.
Open the task manager and you can view the running status of MYSQL.
insert image description here
Here MYSQL is installed, can you do it,
if there is a problem with the installation Add me as a friend to help you solve it for free! ! !

Guess you like

Origin blog.csdn.net/m0_46590717/article/details/120261231