MySQL server and workbench installation and use

1 Install Notepad++

Run the downloaded npp.7.9.Installer.x64.exe

 

2 Install MySQL

Unzip mysql-8.0.22-winx64.zip, and I will place it in the root directory of the D drive.

Enter the folder, create a new folder data and file my.ini in the directory

 Open my.ini with NotePad++, enter the following content and save, where the directory address is based on your own situation.

[client]
port=3306
[mysql]
default-character-set=utf8mb4
[mysqld]
port=3306
basedir=D:/mysql-8.0.22-winx64
datadir=D:/mysql-8.0.22-winx64/data
character-set-server=utf8mb4
default-storage-engine=INNODB
max_connections=50

Open a command prompt as an administrator to initialize MySQL.

d:

cd D:\mysql-8.0.22-winx64\bin

mysqld --initialize --console

At the end, you can see that the temporary password is: efq<9z*B-y+X , copy it out and record it.

(If the password is lost, delete all the files in the data directory and re-initialize)

In the data directory, you can see that the initialization has been completed.

install service: 

mysqld --install

(If the installation is wrong, you can use sc delete MySQL to delete the service)

In the computer management, you can see that the MySQL service has been successfully installed.

Use the command or click on the service to start the service.

net start MySQL

Use root to log in, mysql -u root -p

Enter the previously saved password: efq<9z*B-y+X

 You can set the password to a simple password, and the statement ends with a semicolon:

ALTER USER 'root'@'localhost' identified by '394202422';

 3 install mysql workbench

The command method is very inconvenient, you can use the graphical interface client. Double-click the following installation package to install.

I have encountered a problem here, the C++ version is too low,

 You need to download and install a Visual C++ first. My computer is 64-bit, so choose X64.

Latest supported Visual C++ Redistributable downloads | Microsoft Learn

 

After the c++ is installed, mysql-workbench-community-8.0.22-winx64.msi can be installed, just click the next step. After entering the password, you can use mysql directly.

 

 

 

 

Guess you like

Origin blog.csdn.net/zhyue77yuyi/article/details/131040974