大佬教程收集整理的这篇文章主要介绍了实验:基于YUM安装的多实例,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
yum install mariadb
@H_419_32@
@H_159_11@mysqL_install_db --datadir=/MysqL/3307/data/ --user=MysqL @H_159_11@mysqL_install_db --datadir=/MysqL/3308/data/ --user=MysqLcp /etc/my.cnf /MysqL/3306/etc
vim /MysqL/3306/etc/my.cnf
[MysqLd]
port=3306 加一行
datadir=/MysqL/3306/data
socket=/MysqL/3306/socket/Mysql.sock
[MysqLd_safe]
log-error=/MysqL/3306/log/mariadb.log
pid-file=/MysqL/3306/pid/mariadb.pid
cp /MysqL/3306/etc/my.cnf /MysqL/3307/etc/my.cnf
/MysqL/3307/etc/my.cnf
@H_674_63@
vim /MysqL/{3306,3308}/bin/MysqLd
cat /mysq/3306/bin/MysqLd
#!/bin/bash port=3306 MysqL_user="root" MysqL_pwd=" " cmd_path="/usr/bin" MysqL_basedir="/MysqL" MysqL_sock="${MysqL_basedir}/${port}/socket/Mysql.sock" function_start_MysqL() { if [ ! -e "$MysqL_sock" ];then printf "StarTing Mysql...\n" ${CR_351_11845@d_path}/MysqLd_safe --defaults-file=${MysqL_basedir}/${port}/etc/my.cnf &> /dev/null & else printf "MysqL is running...\n" exit fi } function_stop_MysqL() { if [ ! -e "$MysqL_sock" ];then printf "MysqL is stopped...\n" exit else printf "Stoping Mysql...\n" ${CR_351_11845@d_path}/MysqLadmin -u ${MysqL_user} -p${MysqL_pwD} -S ${MysqL_sock} shutdown fi } function_restart_MysqL() { printf "RestarTing Mysql...\n" function_stop_MysqL sleep 2 function_start_MysqL } case $1 in start) function_start_MysqL ;; stop) function_stop_MysqL ;; restart) function_restart_MysqL ;; *) printf "Usage: ${MysqL_basedir}/${port}/bin/MysqLd {start|stop|restart}\n" esac
chmod +x /MysqL/{3306,3308}/bin/MysqLd
/MysqL/{3306,3308}/bin/MysqLd start
/MysqL/{3306,3308}/bin/MysqLd stop
以上是大佬教程为你收集整理的实验:基于YUM安装的多实例全部内容,希望文章能够帮你解决实验:基于YUM安装的多实例所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。