Installing MariaDB Binary Tarballs

You are viewing an old version of this article. View the current version here.

MariaDB Binary tarballs are named following the pattern: mariadb-VERSION-OS.tar.gz. Be sure to download the correct version for your machine.

To install the binaries, unpack the distribution into the directory of your choice and run the mysql_install_db script.

In the example below we install MariaDB in the /usr/local/mysql directory (this is the default location for MariaDB for many platforms). However any other directory should work too.

We install the binary with a symlink to the original name. This is done so that you can easily change MariaDB versions just by moving the symlink to point to another directory.

NOTE: For MariaDB 5.1.32 only the line "./scripts/mysql_install_db --user=mysql" should be changed to "./bin/mysql_install_db --user=mysql"

Installing MariaDB as root in /usr/local/mysql

If you have root access to the system, you probably want to install MariaDB under the user and group 'mysql' (to keep compatibility with MySQL installations):

groupadd mysql
useradd -g mysql mysql
cd /usr/local
tar -zxvpf /path-to/mariadb-VERSION-OS.tar.gz
ln -s mariadb-VERSION-OS mysql
cd mysql
./scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data

To start mysqld you should now do:

./bin/mysqld_safe --user=mysql &

To test connection, modify your $PATH so you can invoke client such as mysql, mysqldump, etc.

export PATH=$PATH:/usr/local/mysql/bin/

You may want to modify your .bashrc or .bash_profile to make it permanent.

Installing MariaDB as not root in any directory

Below, change /usr/local to the directory of your choice.

cd /usr/local
gunzip < /path-to/mariadb-VERSION-OS.tar.gz | tar xf -
ln -s mariadb-VERSION-OS mysql
cd mysql
./scripts/mysql_install_db

If you have problems with the above gunzip command line, you can instead, if you have gnu tar, do:

tar xfz /path-to/mariadb-VERSION-OS.tar.gz

To start mysqld you should now do:

./bin/mysqld_safe &

Post installation

After this, remember to set proper passwords for all accounts accessible from untrusted sources, to avoid exposing the host to security risks! Also consider using the mysql.server to start MariaDB automatically when your system boots.

Our MariaDB binaries are similar to the Generic binaries available for the MySQL binary distribution. So for more options on using these binaries, the MySQL 5.1 manual entry on installing generic binaries can be consulted.

For details on the exact steps used to build the binaries, see the compiling MariaDB section of the KB.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.