job.answiz.com
  • 4
Votes
name
name Punditsdkoslkdosdkoskdo

How would I completely remove MySQL from a linux installation?

I was surprised to find that one of my privileged users installed MySQL on a linux box. The server (mysqld) is running and doing nothing. My skills are all in Oracle, so I am unfamiliar with how to shutdown and remove the MySQL installation.

If the user happened to set up any databases, you might need to remove those as well. In package base installation of MySQL, the table files can be found in /var/lib/mysql. If they are elsewhere, you can just search for the table files. They will have a .frm extension, and should be contained in a directory named after the database they are associated with.

  • 0
Reply Report

It all depends on how the original user installed the package. If they used the operating system's built in package management, it should be as easy as the yum line in Dave's answer or on a Debian-based system (including Ubuntu), you can use:

apt-get remove mysql-server

(As an aside, use purge instead of remove if you also want to remove custom configuration files)

If you don't know the exact package name to remove on Ubuntu:

dpkg -l|grep mysql

If the user in question did not use a package management tool, then the only real solution is to simply ensure that the server doesn't load on startup (chkconfig or update-rc.d are two handy tools for that -- check their man pages) and manually remove all the installed files.

  • 0
Reply Report
name
  • 0

You didn't mention what distribution you are using, but if they installed it via yum on a RedHat based distribution you can remove with:

yum remove mysql-server

If they installed it in their own user space you would just remove the binary files that are running the server. If it is on Debian/Ubuntu you would use the method sparks mentioned. I would also alternatively use:

killall mysqld; killall mysqld_safe
  • 0
Reply Report