MARIADB installation Download and decompression MARIADB
cd /usr/local/src/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.gztar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
Moving files
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
Note:/usr/local/cannot have mariadb this directory before moving
Edit Parameter file
cd /usr/local/mariadb./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb
Note: If you have not installed MySQL before, you need to create the/data directory in advance, that is, mkdir/data, if you do not have MySQL user also need to add in advance;
Copy a configuration template
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf
Set boot up
cp support-files/mysql.server /etc/init.d/mariadbvim /etc/init.d/mariadb //定义basedir、datadir、conf以及启动参数修改与指定目录basedir=/usr/local/mariadbdatadir=/data/mariadbconf=$basedir/my.cnf将下面一行加入--defaults-file="$conf" 到中间$bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "[email protected]" & wait_for_ready; return_value=$?
Start the service
Killall off mysqld before you start.
/ETC/INIT.D/MARIADB start
[[email protected] mariadb]# /etc/init.d/mariadb startReloading systemd: [ 确定 ]Starting mariadb (via systemctl): [ 确定 ][[email protected] mariadb]#
MARIADB database binary Compiler-free package installation