Completely uninstall + reinstall MySQL tutorial under win10

Reprint, respect the author, the original address https://blog.csdn.net/qq_22812319/article/details/51586261, thank the author for sharing

I believe that everyone needs to reinstall MySQL for various reasons. Because of the problem when connecting MySQL and Qt, the author had to choose to replace 64bitMySQL with 32bitMySQL. There are various problems with the installation due to the unclean uninstallation. Now I record the process of uninstalling + reinstalling for the reference of those who need it.

 

Step 1: Stop the service

Start cmd-> enter services.msc-> find mySQL-> stop SQL service

 

 

Step 2: Delete the file

Find your installation directory and delete all files

 

Step 3: Delete the Registry

Start cmd-> enter regedit-> search for mySQL, right click to delete all (or find MySQL according to the following path, right click to delete)

HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL 
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL 
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL



Step 4: Configure the my.ini file

The version downloaded by the author is mysql-5.6.17-win32, zip archive, stored in the D drive

Create a new my.ini file in the D:\mysql\mysql-5.6.17-win32\ directory and write the following code:

 

[sql]  view plain copy  
  1. [mysql]  
  2.   
  3. # Set the default character set of the mysql client  
  4.   
  5. default-character-set=utf8  
  6.   
  7. [mysqld]  
  8.   
  9. #Set 3306 port  
  10.   
  11. port = 3306  
  12.   
  13. # Set the installation directory of mysql  
  14.   
  15. basedir=D:\mysql\mysql-5.6.17-win32  
  16.   
  17. # Set the storage directory for the data of the mysql database  
  18.   
  19. datadir=D:\mysql\mysql-5.6.17-win32\data  
  20.   
  21. # maximum number of connections allowed  
  22.   
  23. max_connections=200  
  24.   
  25. # The character set used by the server defaults to the 8-bit encoded latin1 character set  
  26.   
  27. character-set-server=utf8  
  28.   
  29. # The default storage engine that will be used when creating new tables  
  30.   
  31. default-storage-engine=INNODB   

Note that the directory address should be replaced with your own mySQL storage address.

 

Step 5: Installation

Open cmd (note to run as administrator) -> enter cd D:\mysql\mysql-5.6.17-win32\bin

If you enter mysql d  install, you will get the following error:

 

Prompt that the service has been installed.

So, next we need to continue typing mysqld -remove

 

Prompt that the command ran successfully.

Retype mysqld install:

 

Reinstallation was successful!

Type net start mysql:

 

Prompt to start successfully.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324737184&siteId=291194637