如何使用shell脚本自动执行MariaDB安装?

时间:2015-01-25 14:10:30

标签: mysql shell mariadb centos7

我正在编写一个脚本来在CentOS 7中自动安装各种东西,但我无法弄清楚如何在mysql_secure_installation期间自动输入。 我脚本的当前MariaDB部分如下:

#MySQL (MariaDB)
function mysql (){
echo ~~Now Installing MySQL -Attended Installation~~
sleep 1
yum -y install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation
systemctl enable mariadb.service
echo ~~MySQL Installation Complete~~
sleep 2
exit 0
} #MySQL End

0 个答案:

没有答案
相关问题