码迷,mamicode.com
首页 > 数据库 > 详细

一键部署----mysql5.6--jue

时间:2020-11-13 13:21:30      阅读:37      评论:0      收藏:0      [点我收藏+]

标签:源码包   ref   extra   source   usr   一键部署   star   curses   成功   

一键部署----mysql5.6--jue
#!/bin/bash
cd /var/run
rm -rf yum.pid
read -p "请输入mysql源码包的绝对路径" c
cd $c
yum install -y ncurses-devel autoconf cmake

tar xzvf mysql-5.6.26.tar.gz
cd mysql-5.6.26/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DSYSCONFIDIR=/etc -DMYSQL_DATADIR=/home/mysqI/ -DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock

make && make install
\cp support-files/my-default.cnf /etc/my.cnf

cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig --add /etc/init.d/mysqld
cd /etc/init.d/
chkconfig --level 35 mysqld on
echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
useradd -s /sbin/nologin mysql
chown -R mysql.mysql /usr/local/mysql/
cd /usr/local/mysql/scripts/

/usr/local/mysql/scripts/mysql_install_db --user=mysql --ldata=/var/lib/mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data

sed -i ‘46cbasedir=/usr/local/mysql‘ /etc/init.d/mysqld
sed -i ‘47cdatadir=/home/mysql‘ /etc/init.d/mysqld

service mysqld start
echo "mysql已安装成功"

一键部署----mysql5.6--jue

标签:源码包   ref   extra   source   usr   一键部署   star   curses   成功   

原文地址:https://blog.51cto.com/14625831/2547720

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!