MySQL installation and configuration tutorial (detailed explanation with pictures and texts, including a complete MySQL uninstall tutorial)

Table of contents

1. Pre-installation preparation (If the system has not installed MySQL, you can directly ignore it)

1. Open the control panel - uninstall the MySQL program

2. Delete the MySQL project in the installation directory

3. Delete the related registry of MySQL (Win+r---regedit)

4. Delete all files in C:\ProgramData\MySQL (hidden by default)

 5. Restart the computer! ! ! Uninstall complete!

2. Enter the MySQL official website to download  

 3. Install MySQL

 Fourth, configure environment variables

 5. Inspection and installation

 6. Enter MySQL


1. Pre-installation preparation (If the system has not installed MySQL, you can directly ignore it)

If MySQL has been installed in the system before, the old data (former MySQL) must be completely deleted before installing MySQL, otherwise it will directly lead to subsequent installation failure! ! ! The following explains in detail how to completely uninstall MySQL. (Reminder: each of the following steps must not be omitted, otherwise it cannot be uninstalled cleanly)

1. Open the control panel - uninstall the MySQL program

(1) Open the control panel, as shown in the figure below.

(2) Select "Programs and Features" to uninstall all programs about MySQL.

2. Delete the MySQL project in the installation directory

(1) Open C:\Program Files (x86) or C:\Program Files, find the MySQL file and delete it.

(2) Find the path where MySQL was installed before (depending on the path you choose, the default installation path is C drive), delete all MySQL installation files, as shown in the figure below.

 

3. Delete the related registry of MySQL (Win+r---regedit)

Find the following registration information, if not, you can omit it directly.

(1)HKEY_LOCALMACHINE'SYSTEMControlSet001'Services\EventlogApplicationMySQL

  (2)HKEY_LOCALMACHINESYSTEMControlSet002Services\EventlogApplicationMySQI

  (3)HKEYLOCALMACHINESYSTEMCuentControlSetServicesEventlogApplicationMySQL

4. Delete all files in C:\ProgramData\MySQL (hidden by default)

You can view "Hidden Items" through "View" editor, find C:\ProgramData\MySQL and delete all files.

 

 5. Restart the computer! ! ! Uninstall complete!


2. Enter the MySQL official website to download  

MySQL official website link

PS: You can choose to download MySQL from the computer software store, so that the version compatibility will be better. 

Click the DOWNLOADS drop-down page and click " MySQL Community (GPL) Downloads "

 After jumping to the page, select " MySQL Installer for Windows

 Enter and you can select the required version to download the offline installation package (8.0.19 is selected in this article)

 3. Install MySQL

Click the downloaded offline installation package to start mysql-installer-community-8.0.19.0.msi

 Select custom Custom (there is a trick here: first, you can select the first "Development Defaut" Next to enter, then click Back to exit, and then click Custom to enter to automatically match the path)

After entering, the list on the right is automatically matched, and you can click "Advanced Options" to manually change the installation path, as shown below

 

 

 

 Manually change the path one by one, click Next when finished

 Then click Next, which is selected by default. Go to the following page, click Next without modifying. If there is a red exclamation mark in "Port", it means that the port is occupied. For the solution, please refer to: mysql installation error: The specified port already in use

The next step is to enter the following page, select according to the needs, generally select the first one

Set a password (be sure to remember it firmly), the default account is root , after completion

 continue to the next step

 

 Then click Next, come to Apply Configuration, click Execute, and then wait for the green ticks to complete and click Finish

 After jumping to the following page, click Finish

 Click Next

 Enter the password set earlier, click Next after Chect

 Wait for the green ticks to complete and click Finish

 Click Finish to complete all installations!

 Fourth, configure environment variables

Open the settings to search for environment variables, click Edit System Environment Variables

 Open System Properties, click Environment Variables

Click to enter Path

 Create a new environment variable, fill in the bin file storage path of MySQL Server 8.0 (fill in according to your specific installation path), click OK to complete the environment variable configuration.

 

 5. Inspection and installation

Enter cmd in the bin file path of MySQL Server 8.0

 

After opening, enter mysql -u root -p to log in to the database, enter the database password, and view the information.

 Enter the status command to view the version information of MySQL, indicating that the installation is successful.

 6. Enter MySQL

(1) Method 1: Win+r, enter cmd, open it, then enter mysql -u root -p to log in to the database, and enter the database password to enter.

 (2) Method 2: Find MySQL 8.0 Command Line Client in the application and open it

 Enter the database password to enter MySQL

 


Thanks for browsing, welcome to communicate! !

Guess you like

Origin blog.csdn.net/weixin_64260325/article/details/128413271