Forked from brandonsimpson/osx_uninstall_mysql_install_mariadb_homebrew.md
Created
March 8, 2016 12:23
-
-
Save Quizp2p/1bcd03752f46753b96f7 to your computer and use it in GitHub Desktop.
Revisions
-
brandonsimpson revised this gist
Apr 23, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ### OSX How To: Uninstall native MySQL and install MariaDB via Homebrew This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux. -
brandonsimpson revised this gist
Nov 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # OSX How To: Uninstall native MySQL and install MariaDB via Homebrew This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux. -
brandonsimpson revised this gist
Nov 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ $ mysqldump -uroot -p --all-databases --flush-logs --master-data=2 > all_databas ``` ### Second: Backup Your MySQL User Permissions Within the msyqldump above, make sure you have dumped the mysql.users table. Either do this, or dump your mysql table data independently, or make note of your existing mysql user permissions if you just want to manually add them to your clean new MariaDB server later. If you have a lot of different permissions setup, you will probably want to migrate them. If you don't have many db users, you may want to add them manually later so you can get a refresher of how your user permissions are setup. Either way, you should understand your user permissions before removing your old database. -
brandonsimpson revised this gist
Nov 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # OSX How To: Uninstall native MySQL and install MariaDB via Homebrewo This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux. ### First: Backup Your Data! -
brandonsimpson revised this gist
Nov 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # OSX How To: Uninstall native MySQL and install MariaDB via Homebrewo This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well. -
brandonsimpson revised this gist
Nov 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # OXS How To: Uninstall native MySQL and install MariaDB via Homebrew This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well. ### First: Backup Your Data! -
brandonsimpson renamed this gist
Nov 21, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
brandonsimpson created this gist
Nov 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,98 @@ # OXS How To: Uninstall native MySQL and install MariaDB via Homebrew This is a short helper on how to completely remove any old mysql server installs in OSX and upgrade to to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well. ### First: Backup Your Data! Backup all of your current databases with [mysqldump](http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html) This isn't a tutorial on backups, and there are many ways to do it. You should know how to backup your data anyway. For this example, we'll do a full backup of our InnoDB databases. ```sh $ mysqldump -uroot -p --all-databases --flush-logs --master-data=2 > all_databases.sql ``` ### Second: Backup You MySQL User Permissions Within the msyqldump above, make sure you have dumped the mysql.users table. Either do this, or dump your mysql table data independently, or make note of your existing mysql user permissions if you just want to manually add them to your clean new MariaDB server later. If you have a lot of different permissions setup, you will probably want to migrate them. If you don't have many db users, you may want to add them manually later so you can get a refresher of how your user permissions are setup. Either way, you should understand your user permissions before removing your old database. Dump your existing mysql table: ```sh $ mysqldump -uroot -p mysql > mysql.sql ``` After installing your new MariaDB server, you can restore the mysql database by executing: ```sh $ mysql -uroot -p mysql < mysql.sql ``` then make sure to flush privileges for the new user permissions to take effect: ```FLUSH PRIVILEGES``` ### Remove MySQL You are now ready to remove everywhere MySQL has put itself into your OSX system. You may opt to move these folders to a backup folder instead of removing them, but for our case, we want to remove MySQL completely so there are no conflicts later. First, check where mysql is running on your system: ```sh $ which mysql ``` You should see something like: /usr/local/mysql Now, stop the database server: ```sh $ sudo /usr/local/mysql/support-files/mysql.server stop ``` And move/backup or remove the following folders/files: * ```sudo rm /usr/local/mysql``` * ```sudo rm -rf /usr/local/mysql*``` * ```sudo rm -rf /Library/StartupItems/MySQLCOM``` * ```sudo rm -rf /Library/PreferencePanes/My*``` * ```rm -rf ~/Library/PreferencePanes/My*``` * edit /etc/hostconfig and remove the line MYSQLCOM=-YES- These may not exist, but if they do, remove them to avoid any conflicts with other versions of MySQL: * ```sudo rm -rf /Library/Receipts/mysql*``` * ```sudo rm -rf /Library/Receipts/MySQL*``` * ```sudo rm -rf /private/var/db/receipts/*mysql*``` ### Install MariaDB with Homebrew First, make sure you have [homebrew](http://brew.sh/) installed and running, and make sure everything is up to date: ```sh $ brew update ``` You can then run searches (brew search mariadb) , and if you would like to get more information about it, you could do: brew info mariadb. When you're ready to install MariaDB, simply execute: ```sh $ brew install mariadb ``` After homebrew installs MariaDB server, follow the onscreen instructions on how to install the database (```mysql_install_db```) and add your startup scripts if you want MariaDB to load on boot. You should also run ```mysql_secure_installation``` to lock down your install and set your root password. You should now be able to login to mysql with your new root user and see the MariaDB message from the server: ```sh $ mysql -uroot -p Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 48 Server version: 10.0.14-MariaDB Homebrew ``` You can now import your mysql users and dumped databases file as needed.