Sunday, December 28, 2014

How to install MariaDB in Mac

To install MariaDB in Mac,

you can do the following command:

brew install mariadb

You can create default databases with the following command:

sudo mysql_install_db --user=mysql --datadir=/Users/izeye/mysql/data

You should replace '/Users/izeye/mysql/data' with your 'datadir'.

You can run MariaDB server with the following commands:

cd '/usr/local/Cellar/mariadb/10.0.15'

sudo /usr/local/Cellar/mariadb/10.0.15/bin/mysqld_safe --datadir='/Users/izeye/mysql/data'

You can also use mysql.server script.

Open the script with the following command:

vi /usr/local/bin/mysql.server

Set your 'datadir':

datadir=/Users/izeye/mysql/data

Start the script:

sudo mysql.server start

Be careful with your previous MySQL data.

You'd better backup your MySQL data before trying to install MariaDB.

References:
https://mariadb.com/kb/en/mariadb/documentation/getting-started/compiling-mariadb-from-source/building-mariadb-on-mac-os-x-using-homebrew/
http://dev.mysql.com/doc/refman/5.0/en/mysql-install-db.html

No comments:

Post a Comment