一键部署—-mysql5.6–jue

一键部署—-mysql5.6–jue一键部署—-mysql5.6–jue#!/bin/bashcd/var/runrm-rfyum.pidread-p

	一键部署----mysql5.6--jue[数据库教程]

一键部署—-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

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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/6635.html

(0)
上一篇 2023-04-05
下一篇 2023-04-05

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注