How to Remove MySQL from Mac Completely

MySQL for Mac is a product instrument utilized for most well known programming dialects, as PHP, Java, Perl, C, C ++ and others. To put it plainly, it is a database administration framework (DBMS), which enables you to associate with the database, run SQL questions and get a reaction. It might happen that you have to reinstall MySql on your Mac. To do this, you first need to uninstall MySQL and after that install it once more.

ou should realize that a basic expulsion of MySQL from the System Preferences window isn’t sufficient. It is vital to expel MySQL totally, including all its administration files. In this article, we will share two different ways of how to evacuate MySQL effectively on your Mac.

Uninstalling MySQL on Mac Manually

  1. To uninstall MySQL and totally expel it (counting all databases) from your Mac do the accompanying:
  2. Open a terminal window
  3. Utilize mysqldump to backup your databases to content files!

Stop the database server
sudo rm/usr/nearby/mysql
sudo rm - rf/usr/nearby/mysql*
sudo rm - rf/Library/StartupItems/MySQLCOM
sudo rm - rf/Library/PreferencePanes/My*
alter/and so on/hostconfig and expel the line MYSQLCOM=-YES-
rm - rf ~/Library/PreferencePanes/My*
sudo rm - rf/Library/Receipts/mysql*
sudo rm - rf/Library/Receipts/MySQL*
sudo rm - rf/private/var/db/receipts/*mysql*

The last three lines are especially critical as else, you can’t install a more established variant of MySQL despite the fact that you imagine that you’ve totally deleted the more up to date form!

Remove MySQL completely from Mac OS X via Terminal

To expel an occurrence of MySQL from your macOS or OSX installation you have to delete various files by means of the command line, yet first guarantee that you have database dumps of your databases and that then the database server isn’t running.

To uninstall MySQL and totally expel it (counting all databases) from your Mac do the accompanying:

  • Open terminal and utilize mysqldump to backup your current databases. Stop the database server.
  • Move down any required databases
  • Every one of them
  • mysqldump – all-databases > all_databases_export.sql
  • Or on the other hand separately
  • mysqldump database_name > database_exportname.sql

Stop the database server

>= MySQL 5.7

sudo launchctl empty – F/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

< MySQL 5.7

sudo/usr/nearby/mysql/bolster files/mysql.server stop

Delete MySQL

  • sudo rm – rf/usr/neighborhood/mysq*
  • sudo rm/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
  • sudo rm – rf/Library/StartupItems/MySQLCOM
  • sudo rm – rf/Library/PreferencePanes/My*
  • Alter/and so forth/hostconfig and evacuate the line MYSQLCOM=
  • rm – rf ~/Library/PreferencePanes/MySQL*
  • sudo rm – rf/Library/Receipts/mysql*
  • sudo rm – rf/Library/Receipts/MySQL*
  • sudo rm – rf/private/var/db/receipts/*mysql*

Brew install MySQL

  • Mix install MySQL
  • mix specialist and fix any mistakes
  • mix refresh
  • mix install mysql
  • unset TMPDIR
  • mysql_install_db – verbose – user=`whoami` – basedir=”$(brew – prefix mysql)” – datadir=/usr/neighborhood/var/mysql – tmpdir=/tmp
  • mysql.server begin
  • run the commands Brew recommends, add MySQL to launchctl so it naturally dispatches at startup
  • mysql should now work and be running all the time of course