The previous article said that MARIADB compiled the installation process, but in the production environment generally use the released binary version, because the installation process and the same, no longer detailed description, just briefly summarize the installation process:
1. Download Address: https://downloads.mariadb.org/
Here choose the latest version of the 10.1.19 stable version, after entering the choice according to the number of computers, here to download the Linux x86_64 version for 64-bit operating system
Here the download contains glibc and does not contain glibc is all right, if the download contains glibc, then the glibc version of the system to meet the requirements, here is more than 2.14, the general system can be satisfied
Upload to server for installation after download
2. Release the installation package assuming the installation location is/USR/LOCAL/MARIADB package name: mariadb-10.1.19-linux-x86_64.tar.gz
tar -xvzf mariadb-10.1. -linux-x86_64. Tar . GZ MV mariadb-10.1. -linux-x86_64/usr/local/mariadb//usr/local/mariadb
Be careful not to set up the/USR/LOCAL/MARIADB directory in advance, just let it go
3. Related configurations
Backup legacy MySQL configuration: mv /etc/my.cnf/etc/my.cnf.bak
In the MARIADB installation directory, Support-files has several configuration templates, already configured partial parameters, respectively, for different production environments, where the default use of MY-SMALL.CNF, copy the configuration file: mv SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF
Edit profile: vim/etc/my.cnf Add the Basedir Global directory in the [MYSQLD] block to the default data directory, log directory, PID files are placed in the Basedir directory, configured as follows:
Basedir =/usr/local/mariadb
Configuration complete, Save and exit
For initial installation, create MySQL users and groups and give permissions to the current directory:
-r-g mysql-s/sbin/nologin mysqlchown -r MySQL. chgrp -R MySQL.
Then perform the initialization installation: ./scripts/mysql_install_db--user=mysql
To adjust permissions:
chown -R root. chown -R MySQL data/
Startup script: bin/mysqld_safe--user=mysql &
Add MySQL to System services directory: cp Support-files/mysql.server/etc/init.d/mysqld
If MySQL was installed before, it is now started and the first installation requires a manual start service: /etc/init.d/mysqld start
Add mysqld to system service, start with system: chkconfig mysqld on
View MySQL service running status: systemctl status Mysqld.service
All subsequent operations are exactly the same as before MySQL.
Linux installation mariadb binary version