Installing MariaDB Binary Tarballs

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

Note: Some binary tarballs are marked '(GLIBC_2.14)' or '(requires GLIBC_2.14+)'. These binaries are built the same as the others, but on a newer build host, and they require GLIBC 2.14 or higher. Use the other binaries for machines with older versions of GLIBC installed. Run ldd --version to see which version is running on your distribution.

Others are marked 'systemd', which are for systems with systemd.

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"

Ensure you use the correct my.cnf files

MariaDB searches for the configuration files '/etc/my.cnf' (on some systems '/etc/mysql/my.cnf') and '~/.my.cnf'. If you have an old my.cnf file (maybe from a system installation of MariaDB or MySQL) you need to take care that you don't accidentally use the old one with your new binary .tar installation.

The normal solution for this is to ignore the my.cnf file in /etc when you use the programs in the tar file.

This is done by creating your own .my.cnf file in your home directory and telling mysql_install_dbmysqld_safe and possibly mysql (the command-line client utility) to only use this one with the option '--defaults-file=~/.my.cnf'. Note that this has to be first option for the above commands!

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

The symlinking with ln -s is recommended as it makes it easy to install many MariaDB version at the same time (for easy testing, upgrading, downgrading etc).

If you are installing MariaDB to replace MySQL, then you can leave out the call to mysql_install_db. Instead shut down MySQL. MariaDB should find the path to the data directory from your old /etc/my.cnf file (path may vary depending on your system).

To start mysqld you should now do:

./bin/mysqld_safe --user=mysql &
or
./bin/mysqld_safe --defaults-file=~/.my.cnf --user=mysql &

To test connection, modify your $PATH so you can invoke client such as mysqlmysqldump, 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 --defaults-file=~/.my.cnf

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 --defaults-file=~/.my.cnf &

Auto start of mysqld

You can get mysqld (the MariaDB server) to autostart by copying the file mysql.server file to the right place.

cp support-files/mysql.server /etc/init.d/mysql.server

The exact place depends on your system. The mysql.server file contains instructions of how to use and fine tune it.

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.5 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

 
1 year, 7 months ago  trupti_mali_g

Hi, I have been trying to install mariadb 10.1.8 from Binary referring this document. But there are no clear cut steps to be followed as I am stumbling upon every step while calling the script mysql_install_db. I am installing this on a clean slate. Am I supposed have / copy any preexisting files to certain directories?

I am getting below error -

root@localhost:/usr/local/mysql# ./scripts/mysql_install_db  --basedir=/usr/local/mysql 
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2015-12-08  8:56:59 140556698441600 [Note] /usr/local/mysql/bin/mysqld (mysqld 10.1.8-MariaDB-log) starting as process 26886 ...
2015-12-08  8:56:59 140556698441600 [ERROR] mysqld: File '/var/log/mysql/mariadb-bin.index' not found (Errcode: 2 "No such file or directory")
2015-12-08  8:56:59 140556698441600 [ERROR] Aborting
 
9 months, 1 week ago  Ivan Zoratti

You are probably using a configuration file in /etc. Make sure you have your own configuration file, usually in the mariadb server base directory. For example, if the base directory is /usr/local/mysql, you should execute: ./scripts/mysql_install_db --basedir=/usr/local/mysql --defaults-file=/usr/local/mysql/my.cnf

 
3 years, 5 months ago  adamscott

To check which version of GLIBC you have installed: ldd --version

You can also "run" the libaray: /lib/libc.so.6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值