Download the official website https://www.mysql.com/
Switch to the download tab page
Find MySQL Community Server or MySQL Community (GPL) Downloads --> MySQL Community Server
Click the download button:
Click download to enter the download page and select No thanks, just start my download to start downloading.
Download completed and install
Open the installation package and click Next
to configure:
Set password and confirm password, both are set to root here
The service name is the default and
permissions are granted.
The installation is complete
After the installation is complete, open cmd and check whether the installation is successful.
Open cmd as an administrator and enter the command mysql -u root -p. The access password will be set. The password set during the installation above is root. You can see the output welcome to the mysql..., indicating that we have successfully installed it.
If you enter the mysql -u root -p command and it shows that mysql does not exist or cannot be found, you can check whether the environment variables are not configured:
This computer – right-click Properties – Advanced system settings. Click
on environment variables
. Click on the path in the system variables
in the computer. Find C:\Program Files\MySQL\MySQL Server 5.7\bin
and configure everything in the environment variables
, click OK, close the environment variable configuration window, then open cmd as an administrator, enter the command mysql -u root -p and see again Is it successful? If it still doesn't work, uninstall and reinstall.
uninstall
You can see that it has been downloaded to C:\ProgramData\MySQL. Generally, ProgramData is a hidden directory. You can see it by manually opening the hidden directory.
Find Control Panel-Program Uninstall
Find mysql, right-click to uninstall it
Manually delete the C:\ProgramData\MySQL folder to completely uninstall it.
Note: Be sure to uninstall cleanly, otherwise mysql cannot be reinstalled.