Uninstall MySql on Centos linux

I have lost my MySQL^__^ so bad, I need to remove it and reinstall

1. Stop Mysql

/etc/init.d/mysql stop or service mysqld stop

2. Check Mysql package installed

temp]# rpm -qa | grep -i mysql




3. Remove all mysql package

rpm -e

4. Check again go back to step 2.

To Reinstall

1. Proceed to the directory where your source package is saved

2. Enter command followed by the package

rpm -ivh



Retrieving mysql database v4.1 to mysql 4.0

If you encounter error from dumping the database from mysql 4.1 into old version mysql 4.0 (see below):


[root@cadisetrama]# mysql database

ERROR 1064 at line 21: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘DEFAULT CHARSET=latin1’ at line 21


you may fix it with redumping the database using below code from server A with mysql version 4.1

mysqldump -uroot -pkunGfu123 –compatible=mysql40 database > database.sql



-u[user] -p[password] compatibility for version 4.0 your database filename database.sql extension

mysqldump -uroot -pkunGfu123 –compatible=mysql40 database > database.sql


Hope this may help ^__^