Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here's how i do it so that you can use either mysql or mariadb since mariadb is a drop in replacement (typing this from memory, so please let me know if there are some mistakes)...</p> <p>0) make a backup of your mysql db dir just in case, and do some mysql prep just in case</p> <pre><code>$ cp -R /Applications/MAMP/db/mysql /Applications/MAMP/db/mysql.2013-02-06-1850.bak $ /Applications/MAMP/bin/repairMysql.sh $ /Applications/MAMP/bin/quickCheckMysqlUpgrade.sh $ /Applications/MAMP/bin/upgradeMysql.sh </code></pre> <p>1) make a copy or take note of some settings in your my.cnf file. It can be located in a variety of different places, so to find them all (there are a bunch):</p> <pre><code>$ locate my.cnf /Applications/MAMP/conf/my.cnf /etc/my.cnf /usr/local/etc/my.cnf /usr/local/etc/my.cnf.d /usr/local/etc/my.cnf.d/client.cnf /usr/local/etc/my.cnf.d/mysql-clients.cnf /usr/local/etc/my.cnf.d/server.cnf </code></pre> <p>2) figure out which my.cnf was loaded (for MAMP, it MAY be in /Applications/MAMP/conf/my.cnf)</p> <pre><code>$ /usr/local/bin/mysql --help | grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf $ /Applications/MAMP/Library/bin/mysql --help | grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /Applications/MAMP/conf/my.cnf ~/.my.cnf </code></pre> <p>3) make a backup of the my.cnf in /etc/my.cnf and edit my.cnf to make sure it's got a few parameters in there, most importantly the port, socket, and datadir settings so that mariadb will know where to look for your db files:</p> <pre><code>$ sudo cp /etc/my.conf /etc/my.cnf.2013-02-06-1858.bak $ sudo vi /etc/my.cnf port = 3306 socket = /Applications/MAMP/tmp/mysql/mysql.sock datadir = /Applications/MAMP/db/mysql tmpdir = /Applications/MAMP/tmp/mysql </code></pre> <p>4) add any mariadb specific config options you may want in a [mariadb] section</p> <p>5) install mariadb (i like using brew, but pick your poison)... and you can really do this any time</p> <pre><code>$ brew install mariadb </code></pre> <p>6) make a symbolic link from the my.conf from step two</p> <pre><code>$ sudo ln -s /Applications/MAMP/conf/my.cnf /etc/my.cnf </code></pre> <p>6a) you can put your my.cnf anywhere, as long as there's a copy or link to it in /etc/my.cnf... the goal here is to have mariadb and MAMP's implementation of mysql use the same config settings.</p> <p>7) now make a shell shell script to load apache and mariadb</p> <pre><code>$ mkdir -p ~/scripts/mamp $ touch ~/scripts/mamp/startSomething.sh ~/scripts/mamp/stopSomething.sh $ chmod ug+rx ~/scripts/mamp/*Something.sh </code></pre> <p>8) get/take note of the current start/stop script for apache (it'll prob won't be anything fancy)</p> <pre><code>$ more /Applications/MAMP/bin/startApache.sh $ more /Applications/MAMP/bin/stopApache.sh </code></pre> <p>9) get the installed mariadb path, and make sure it's the mariadb version</p> <pre><code>$ which mysql /usr/local/bin/mysql $ mysql --version mysql Ver 15.1 Distrib 5.5.29-MariaDB, for osx10.8 (i386) using readline 5.1 </code></pre> <p>10) now edit startSomething.sh</p> <pre><code># /bin/sh /Applications/MAMP/Library/bin/apachectl start /usr/local/bin/mysql.server start &amp; </code></pre> <p>11) do the same for stopSomething.sh</p> <pre><code># /bin/sh /Applications/MAMP/Library/bin/apachectl stop /usr/local/bin/mysql.server stop &amp; </code></pre> <p>12) that's it!. to start or stop things</p> <pre><code>$ ~/scripts/mamp/startSomething.sh $ ~/scripts/mamp/stopSomething.sh </code></pre> <p>if you want the vanilla MAMP, use the MAMP app that came with MAMP. otherwise, have fun with this slightly faster database with a bunch of fun new features... but keep in mind that while mariadb is by design a drop in replacement for mysql, it's not true the other way around (<a href="https://kb.askmonty.org/en/mariadb-versus-mysql-compatibility/" rel="nofollow">MariaDB v MySQL compatibility</a>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload