Mysql compressed version installation and configuration steps

Mysql has a compressed version and an msi version. After the compressed version is downloaded, it is installed and uncompressed, but it needs to be configured before it can be used. The following describes the installation and configuration method of the Mysql compressed version of the Windows system.

1. First go to the Mysql official website to download the compressed version, address: https://dev.mysql.com/downloads/mysql/

2. After opening the website, find this place to download.Insert picture description here

3. Go to this page after clicking Download, click directly to download at the bottom left.
Insert picture description here

4. After downloading, find a path to unzip.
Insert picture description here

5. Then configure the environment variables (right-click on this computer, properties, advanced system settings, environment variables, create a new system variable, the variable name is: MY_HOME , the value is mysql path )
Insert picture description here

OK, then find the Path variable in the system variable , edit, create: % MYSQL_HOME% \ bin

In this way, even if the configuration is complete.
Insert picture description here
6. Then you need to create a configuration file my.ini in the decompression path (create a new text box with the name my and the suffix named ini), then edit and enter the following code and save it.
Insert picture description here

Insert picture description here

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置mysql的端口口号
port = 3306
# 设置mysql的安装目录
basedir=D:\mysql\mysql-5.6.33-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\mysql\mysql-5.6.33-winx64\data
# 允许最大连接数
max_connections=2000
# 服务端使用的默认字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

7. Open cmd as administrator
Insert picture description here

8. After opening, first enter the bin directory under the Mysql installation path (first enter the drive letter of your own installation path :, and then enter the path of the cd bin, for example, if I install it on the E drive, enter it e:, and then enter it cd E:\mysql\mysql-8.0.19-winx64\bin), refer to the picture .
Insert picture description here

  1. Execute mysqld --installcommand installation
    Insert picture description here

10. After the installation is complete, first initialize: After the initialization mysqld –initialize –console, there will be a mysql initial password. Be sure to write it down, and you will need to log in to change your own password.
Insert picture description here

11. Start the service. command:net start mysql
Insert picture description here

12. Log in to mysql. Command:mysql -u root -p
Insert picture description here

13. It is recommended to change the password after successful login. Command: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '980824';
Insert picture description here
14. After changing the password, you can quit (exit) and try to log in again with the new password.
Insert picture description here
You can log in without entering the Bin directory.
Insert picture description here

In this way, mysql has been all done. If you want to use it in the future, you can open CMD as an administrator and directly enter the command: mysql -u root –pto log in and use it.

Published 8 original articles · Likes2 · Visits 319

Guess you like

Origin blog.csdn.net/WHD1998/article/details/104708321