How to completely uninstall MySQL (XP)

Source: Internet
Author: User
Tags win32 administrator password mysql command line

How to completely uninstall MySQL

A complete way to uninstall MySQL 5.x:

1, the Control Panel in the increase in the removal program to delete

2, delete the MySQL installation folder C:\Program Files\mysql, if the backup is good, you can delete all folders directly

3, start-to-run, regedit look at the registration table these places delete No

Hkey_local_machine\system\controlset001\services\eventlog\application\mysql Directory Removal

Hkey_local_machine\system\controlset002\services\eventlog\application\mysql Directory Removal

Hkey_local_machine\system\currentcontrolset\services\eventlog\application\mysql

4, this article is very important

C:\Documents and Settings\All Users\Application Data\mysql

There are also MySQL files that have to be removed

Note: Application Data This folder is hidden, need to open a folder to select menu bar tools → folder Options → view → hidden files and folders an option to show all files and folders ok

5. Delete MySQL Service

Open command Line input sc delete mysql command
C:>SC Delete MySQL
[SC] DeleteService SUCCESS

Finish the above 5 reinstall

One, the wizard installs the last page, appears cannot create Windows service for mysql.error:0 Error
WORKAROUND: Open the command line input sc delete mysql command
C:>SC Delete MySQL
[SC] DeleteService SUCCESS
Restart the computer, or uninstall and restart the installation, so it's OK. I didn't reboot, and the installation was successful.

Uninstall reinstall to pay attention to a problem, after uninstalling in the Control Panel, go to c:\Documents and Settings\All Users\Application The data directory to delete the MySQL folder. It may contain information about the configuration you uninstalled and will affect the next time you install it.
Second, in the input administrator input password in addition to password and Confirm password There is a line of current password. This means that you have not removed the MySQL folder from the directory I mentioned in 1th before you installed it. Do not know whether to affect the subsequent use, may remember the password is OK. Another sentence, the administrator password is set by itself, the user name is the default root.

After successful installation, you can test the following: Open MySQL command line client, enter the password, appear
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.1.33-community MySQL Community Server (GPL)
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the buffer.
Mysql>
The installation is successful!
Third, the MySQL server configuration failed. The following statements are available in the Configuration Wizard to view the error message:
mysql-server-5.5-win32:60-adding firewall rule for MySQL55 on port 3306.
mysql-server-5.5-win32:66-adding firewall rule failed.
Indicates that the firewall installation failed.

View the installation log to find the following statement:
Mysql-installer information:10:attempting to create firewall rule with Command:netsh.exe Firewall add portopening Pro Tocol=tcp port=3306 profile=all name=mysql55 mode=enable scope=all
Mysql-installer information:10:unexpected response from netsh: ok.
Mysql-installer information:10:attempting to create firewall rule with Command:netsh.exe advfirewall Firewall add Rul E name= "Port 3306" protocol=tcp localport=3306 dir=in Action=allow
Mysql-installer information:10:unexpected response from Netsh: The following command was not found: Advfirewall firewall add Rule name= "Port 3306" Protocol=tcp localport=3306 dir=in Action=allow.

This situation indicates that the installation of MySQL does not support the Chinese system, does not recognize the "OK" information returned by Netsh.exe, and then runs the Netsh.exe advfirewall command that can run on other Windows platforms (the command XP does not support Therefore, the report could not find the error of the command.

There are two solutions:
① set the language of your operating system to English, and then reinstall MySQL. The specific can go to the Control Panel, area and language to change; Also, check that the current user has permission to start the firewall, view the properties of the application Layer Gateway service in the computer service, and see if the user on the Logon tab is the current user.
② Check the firewall port, if it has been added successfully, do not process, if not added successfully, you manually add the port in the firewall.
After the installation is successful, MySQL server can only be connected via MySQL 5.5 command line client to localhost and not remotely via workbench or other client tools. Keyword: You cannot connect to MySQL server remotely. Possible causes:
① There are no openings, see the previous fix.
② user is not authorized to connect remotely.
③mysql server does not allow remote connections.

For ② users who do not have an authorized remote connection, you can authorize the user, such as the default root user, to enter the following command in the MySQL 5.5 command line client:
Select Database
Mysql>use MySQL;
Give the user authorization, YourPassword field with your password instead
Mysql>grant all priileges on * * to identified by ' YourPassword ';
Refresh System Permissions Table
Mysql>flush privileges;

See if authorization is successful
Mysql> show grants for roots;

If a recent authorization appears, it is successful. If you don't succeed, add a new user and add a user's command:
Insert into Mysql.user (host,user,password,ssl_cipher,x509_issuer,x509_subject) VALUES ("%", "NewUser", Password (" NewPassword "), ', ', ')

The workaround for ③mysql server not to allow remote connections is to find your own My.ini and add a line of statements under [MYSQLD]:
bind-address=0.0.0.0
Indicates that the IP is not bound and restarts your MySQL service.


V. Location of the configuration file My.ini the MySQL Configuration Wizard places the My.ini file in the installation directory of the MySQL server. This will help to associate the configuration file with the specific server instance. To ensure that the MySQL server knows where to look for the My.ini file, parameters similar to the following will be passed to the MySQL server as part of the service installation:--defaults-file= "C:\Program files\mysql\mysql Server 5.5\my.ini C:\Program files\mysql\mysql Server 5.5 can be replaced by the installation path that points to the MySQL server.

Edit My.ini: You can use a text editor to open the file and make the necessary edits and modifications. You can also modify the server configuration with the MySQL administrator application. MySQL clients and applications, such as the MySQL command-line client and mysqldump, are not able to determine the location of the My.ini file located in the server installation directory. In order to configure the client and the application, depending on your version of Windows, generate a new file My.ini file under C:\Windows or in the C:\WINNT directory

If your MySQL Configuration Wizard discovers an existing My.ini file, you can reconfigure the existing server, or remove the server instance by removing the My.ini file, stopping and removing the MySQL service. Reconfigure the server that already exists, select the RECONFIGURE instance option and select the Next button. An already existing My.ini file is renamed to Mytimestamp.ini.bak, and the timestamp is the date and time that the My.ini was created when it existed. Remove the existing DB instance, select the Remove Instance option and select the Next button. If the "Remove instances" option is selected, go to the confirmation screen. Click the Run button: the MySQL Configuration Wizard stops and starts removing the MySQL service and deletes the My.ini file. However, the server installation directory is not removed. If you selected the RECONFIGURE instance option, you can choose to install the type of installation you want to configure by entering the configuration type interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.