MySQL 8.0 installation tutorial steps (windows 64-bit)

1. Download the compressed package version

https://dev.mysql.com/downloads/mysql/
MySQL 8.0 installation tutorial steps (windows 64-bit)

2. Decompress mysql-8.0.23-winx64 and place it in the root directory of Disk D

MySQL 8.0 installation tutorial steps (windows 64-bit)

3. Configure the initial my.ini file

There is no my.ini file in the decompressed directory. Create my.ini in the installation root directory (new text file, change the file suffix to .ini), and write the configuration:

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

The path in the configuration file should be consistent with the actual storage path (8.0.18 do not manually create the Data folder)

MySQL 8.0 installation tutorial steps (windows 64-bit)

4. Initialize Mysql

1) Open the bin directory under mysql

MySQL 8.0 installation tutorial steps (windows 64-bit)

2) Select all the red boxes above

MySQL 8.0 installation tutorial steps (windows 64-bit)

3) Enter cmd and a command box will pop up

MySQL 8.0 installation tutorial steps (windows 64-bit)

4) Enter mysqld --initialize --user=mysql --console in the command box

MySQL 8.0 installation tutorial steps (windows 64-bit)

5) The red box below the above figure is the login password of Mysql generated by the system (copy to txt first)

MySQL 8.0 installation tutorial steps (windows 64-bit)

If the above error message appears during the initialization process, please download the relevant Microsoft patch and install it.

5. Install Mysql and start Mysql

enter

      mysqld --install

You will be prompted to install successfully
enter

       net start mysql

Start the Mysql service
MySQL 8.0 installation tutorial steps (windows 64-bit)

6. Modify the initial password

enter

 mysql -u root -p

Copy and paste the initial password generated by the system just now
MySQL 8.0 installation tutorial steps (windows 64-bit)

enter

ALTER USER'root'@'localhost' IDENTIFIED BY'new password'; (change password)

Guess you like

Origin blog.51cto.com/13242922/2677920