MariaDB binary installation, mariadb binary
Download the binary installation package
wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.2.12/bintar-linux-x86_64/mariadb-10.2.12-linux-x86_64.tar.gz
Create a mysql user and group
useradd -r mysql -s /sbin/nologin
Decompress the binary installation package to/usr/local.
tar xf mariadb-10.2.12-linux-x86_64.tar.gz -C /usr/local
Create soft link
cd /usr/local/ln -s mariadb-10.2.12-linux-x86_64/ mysql
Set directory owner Group
chown -R mysql.mysql mysql/
Configure system environment variables
cd mysql/binecho 'PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh. /etc/profile.d/mysql.sh
Mount the logical volume that stores data to/data/mysqldb
mkdir -pv /data/mysqldbblkidecho 'UUID=45943ceb-06b8-4cb8-8c73-53c751956288 /data/mysqldb xfs defaults 0 0' >> /etc/fstabmount -a
Set database folder owner Group Permissions
chown -R mysql.mysql /data/mysqldb/chmod 770 /data/mysqldb/
Create Database Files
cd /usr/local/mysqlscripts/mysql_install_db --datadir=/data/mysqldb --user=mysql
Copy the sample configuration file
cd support-files/cp my-huge.cnf /etc/my.cnf
Modify my. cnf configuration file
Start script
Cp mysql. server/etc/init. d/mysqldll/etc/init. d/mysqld # Check whether the chkconfig -- add mysqldservice mysqld start has the execution permission
Security Initialization
mysql_secure_installation
Test Logon