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:
- [mysql]
- # Set the default character set of the mysql client
- default-character-set=utf8
- [mysqld]
- #Set 3306 port
- port = 3306
- # Set the installation directory of mysql
- basedir=D:\mysql\mysql-5.6.17-win32
- # Set the storage directory for the data of the mysql database
- datadir=D:\mysql\mysql-5.6.17-win32\data
- # maximum number of connections allowed
- max_connections=200
- # The character set used by the server defaults to the 8-bit encoded latin1 character set
- character-set-server=utf8
- # The default storage engine that will be used when creating new tables
- 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.