2014년 1월 15일 수요일

Uninstall MariaDB or MySQL completely

Initially, I just wanted to use MariaDB instead of MySQL with ReviewBoard.
But actually ReviewBoard 1.7.21 doesn't support MariaDB.(see http://www.reviewboard.org/docs/manual/1.7/admin/installation/linux/#before-you-begin)

MariaDB says it can replace MySQL in most cases, Actually configurations or command of MariaDB is nearly the same, even 'mysqld' is used in MariaDB!

So I just tested.

Well, I don't know the exact reason, but as a result, they don't get together.



So I decided to remove MariaDB and installed MySQL, and wished everything went OK.
But.. MySQL didn't work.
'mysqld_safe' exits with error, because it can't write the pid file into /var/run/mysqld.
I fixed the owner, group and so on, but still 'mysqld_safe' didn't work.
And I reinstalled the mysql-client, mysql-server through 'sudo apt-get install mysql-client' and 'sudo apt-get install mysql-server', but still 'mysqld_safe' didn't work.

So I wanted to 'clear' mysql stuff, so as to say, uninstall MariaDB and MySQL completely, and I did it finally!
Here is the deal.

1. Verify any mysql related packages.
sudo dpkg -l | grep mysql

2. Purge all the packages by continuously doing,
sudo dpkg -P <mysql-related-packages>

3. Do 2 until 'sudo dpkg -l | grep mysql' shows nothing

4. Remove MySQL configs
sudo rm -rf /etc/mysql

5. Remove daemon directory
sudo rm -rf /var/run/mysqld

6. Remove MySQL(MariaDB uses this directory, too) databases. Of course the backup of databases is needed before remove it.
sudo rm -rf /var/lib/mysql

7. Remove MySQL related logs
sudo rm -rf /var/log/mysql*

Now, you can start the MySQL after reinstalling it.





댓글 없음:

댓글 쓰기