mysql5.6 源码安装脚本
#!/bin/bash
mkdir /mydata/data -pv
groupadd -r mysql
useradd -g mysql -r -s /sbin/nologin -M -d /mydata/data mysql
chown -R mysql:mysql /mydata/data
cd /usr/local/src
tar zxvf mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz -C /usr/local
cd /usr/local
ln -sv mysql-5.6.21-linux-glibc2.5-x86_64 mysql
cd mysql
chown -R mysql:mysql .
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/mydata/data
chown -R root .
cp my.cnf /etc/
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
echo "MANPATH /usr/local/mysql/man" >> /etc/man.config
ln -sv /usr/local/mysql/include /usr/include/mysql
echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
ldconfig
echo "/usr/local/mysql/bin" >> /etc/profile.d/mysql.sh
source /etc/profile
cp /etc/my.cnf /etc/my.cnf.bak
echo "Everything Is Done."
本文出自 “常用文档” 博客,请务必保留此出处http://yujianglei.blog.51cto.com/7215578/1575189
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。