tar xf mariadb-5.5.68-linux-x86_64.tar.gz
mv mariadb-5.5.68-linux-x86_64 /usr/local/
2.制作链接文件
cd /usr/local/
ln -s mariadb-5.5.68-linux-x86_64 mysql
3.修改属主属组
useradd -r mysql -s /sbin/nologin
chown root:mysql -R mariadb-5.5.68-linux-x86_64
4.创建数据存放目录
mkdir -p /mydata/data
chown mysql:mysql /mydata/data
5.初始化数据库
cd /usr/local/mysql/scripts
./mysql_install_db --basedir=/usr/local/mysql --user=mysql --datadir=/mydata/data
chown mysql:mysql /mydata/data
6.copy启动脚本
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
8.拷贝配置文件(路径可以也是/etc/my.cnf或/etc/mysql/my.cnf或安装目录下的.my.cnf)
cp /usr/local/mysql/support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
9.修改配置文件
#修改therad_concurrency数为主机核心数的2倍
thread_concurrency = 8
#增加数据目录及安装目录
basedir = /usr/local/mysql
datadir = /mydata/data
#增加表
innodb_file_per_table = on
10.启动
/etc/init.d/mysqld5 start
原文:https://blog.51cto.com/4462719/2499925