2021Mysql8.0 installation tutorial is super detailed
Official website download
1 Official website address:
https://dev.mysql.com/downloads/mysql/
2 Click the red box to go to the download page
3 Choose a 64-bit downloader, the one with the larger memory I downloaded directly here, can be installed offline after downloading
4 Don’t choose to log in, download directly (see arrow)
installation
5 After the download is complete, double-click the file you just downloaded, select Custom, and then click next.
6 Expand the left frame until it is consistent with the picture, click the option at the end of the branch, use -> to add it to the right, and add Tick all the boxes on the right, click next
7 click excute
8 prompt to install vc++, just follow the prompt to install it (if not, go to the next one)
9 click Executive
10 click next
11 click next
12 click next
13 click next
14 click Enter the password as shown in the figure and repeat it once, click next
15 click next
16 click Executive, wait for all the tasks in the circle to be configured
17 configuration is complete, click finish
18 Click next
19 Click finish and
click Finish, Mysql is installed.
Environment configuration
1 Right-click on this computer-Properties-Advanced System Settings-Environment Variables
2 Find Path in System Variables
3 Edit-New, find the installation path of Mysql, here is C:\Program Files\MySQL\MySQL Server 8.0\bin
4 Create a new environment variable, copy and paste the installation path, and confirm
5 Open cmd as an administrator (search cmd in the computer search bar and run it as an administrator)
6 Enter:
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
Use cd to change the path to the path where Mysql is installed.
7 Enter:
mysqld -install
When Service successfully installed. appears, the installation is successful.
8 Initialization
Create a txt file on the desktop or elsewhere, and rename the file to my.ini as an initialization configuration file. Enter the following:
[mysqld]
basedir=C:\Program Files\MySQL\MySQL Server 8.0
datadir=C:\Program Files\MySQL\MySQL Server 8.0\data
port=3306
Click save. Then add this file to the mysql server 8.0 folder (that is, add the file at the same level as the bin in the previous step). (*If your 3306 port is occupied, change another port.)
9 Continue to enter the command line in the bin directory:
mysqld --initialize --console
Initial configuration After the
configuration is completed, the random password pointed to by the arrow above will appear.
Enter net start mysql to connect to mysql, and there is an error that cannot be started.
Here you can refer to my previous blog to solve it.
net start mysql MySQL service is starting. MySQL service could not be started. The service did not report any errors. It's
actually very simple. Find the pid corresponding to the port and end it in the task manager!
Started successfully.
Here is the end of mysql installation and environment configuration! Start using it happily!