 <p>Install db</p> <pre><code>sudo -u _mysql /opt/local/lib/mariadb/bin/mysql_install_db </code></pre> <p>Change root password</p> <pre><code>/opt/local/lib/mariadb/bin/mysqladmin -u root password 'new-password' </code></pre> <p>Alternatively you can run:</p> <pre><code>/opt/local/lib/mariadb/bin/mysql_secure_installation' </code></pre> <p>You can start the MariaDB daemon with:</p> <pre><code>cd /opt/local; /opt/local/lib/mariadb/bin/mysqld_safe --datadir='/opt/local/var/db/mariadb' </code></pre>