shell 脚本安装MariaDB

#!/bin/bash

#Mariadb   superlee

#linux version centos6.7

cd /home/soft

wget https://downloads.mariadb.org/interstitial/mariadb-galera-10.0.16/bintar-linux-x86_64/mariadb-galera-10.0.16-linux-x86_64.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/


[ -d /home/soft/mariadb-galera-10.0.16-linux-x86_64 ] || tar -zxvf mariadb-galera-10.0.16-linux-x86_64.tar.gz


mv /home/soft/mariadb-galera-10.0.16-linux-x86_64 mysql

groupadd mysql

useradd -g mysql -r mysql

cd /home/soft/mysql

./configure --prefix=/usr/local/mysql

make

make install

chown -R mysql.mysql mysql

/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/home/data/mysql --basedir=/usr/local/mysql &

cd /home/data/

chown -R mysql.mysql mysql/

/usr/local/mysql/bin/mysql_safe --user=mysql &

cp /home/soft/mysql/support-files/mysql.server /etc/init.d/mysqld

cp /home/soft/mysql/support-files/my-medium.cnf /etc/my.cnf


/usr/local/mysql/bin/mysqladmin -u root password '123456'

/usr/local/mysql/bin/mysql_secure_installation

/etc/init.d/mysqld start










本文转自super李导51CTO博客,原文链接: http://blog.51cto.com/superleedo/1891284,如需转载请自行联系原作者


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值