Installing MARIADB
To the/USR/LOCAL/SRC directory
cd /usr/local/src
Download the MARIADB installation package (due to the MARIADB server in the United States, so the download is slower and takes about 40 minutes.) The quickest way is to use the Thunder download, upload to the server above the
wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/ Mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
Unpacking the installation package
tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
Move the unpacked package to/usr/local/, and change the name to MARIADB
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb/
Create a user for MySQL
useradd mysql
Create a Data directory
mkdir data
Initializes the database, specifying DATADIR
./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb
Copy configuration template
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf
Copy the startup script (if you only install MARIADB and don't have MySQL installed, just put it in the/etc/.)
cp support-files/mysql.server /etc/init.d/mariadb
Edit the startup script configuration file
vim /etc/init.d/mysqld
Find Basedir and DataDir to change the content as follows: (conf is added yourself, if only mariadb on the computer does not need to add conf)
Basedir=/usr/local/mariadb
Datadir=/data/mariadb
Conf=/usr/local/mariadb/my.cnf
After customizing the Conf, you need to specify the start command below to add the startup default profile
Add to
--defaults-file="$conf"
Start the service
service mariadb start
To see if the service is started
ps aux |grep mariadb
View ports
netstat -ltnp
Install MARIADB, install Apache