标签:MariaDB mariadb 二进制免编译包安装mariadb
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.gz
tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
注意:在移动前/usr/local/不能有mariadb这个目录
cd /usr/local/mariadb
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb
注意:如果之前没有安装MySQL的,就需要提前创建/data目录,也就是mkdir /data;如果没有mysql用户也需要提前添加;
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf
cp support-files/mysql.server /etc/init.d/mariadb
vim /etc/init.d/mariadb
//定义basedir、datadir、conf以及启动参数
修改与指定目录
basedir=/usr/local/mariadb
datadir=/data/mariadb
conf=$basedir/my.cnf
将下面一行加入--defaults-file="$conf" 到中间
$bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &
wait_for_ready; return_value=$?
启动之前要killall 掉mysqld
/etc/init.d/mariadb start
[root@shu-test mariadb]# /etc/init.d/mariadb start
Reloading systemd: [ 确定 ]
Starting mariadb (via systemctl): [ 确定 ]
[root@shu-test mariadb]#
标签:MariaDB mariadb 二进制免编译包安装mariadb
原文地址:http://blog.51cto.com/shuzonglu/2073713