gpt4 book ai didi

mysql - AWS Ubuntu 14.04 上的无人值守 MySQL 安装

转载 作者:行者123 更新时间:2023-11-29 22:16:53 31 4
gpt4 key购买 nike

我正在尝试执行以下脚本来在无人值守的情况下安装 MySQL。

“export DEBIAN_FRONTEND=noninteractive”不起作用 - 我仍然需要按几次 Enter 键才能通过提示。

AWS 镜像:Ubuntu Server 14.04 LTS (PV),SSD 卷类型 - ami-d85e75b0

有什么建议吗?

#!/bin/sh

sudo apt-get install libaio1

export DEBIAN_FRONTEND=noninteractive

# Install script for mysql database

sudo groupadd mysql
sudo useradd -r -g mysql mysql
sudo tar xvf mysql-server_5.6.21-1ubuntu12.04_amd64.deb-bundle.tar
if [ $? != 0 ];then echo "Unable to extract tar file."; exit 100; fi

sudo dpkg -i mysql-common_5.6.21-1ubuntu12.04_amd64.deb
if [ $? != 0 ];then echo "Unable to install package mysql-common."; exit 100; fi

sudo dpkg -i mysql-community-server_5.6.21-1ubuntu12.04_amd64.deb
if [ $? != 0 ];then echo "Unable to install package mysql-community-server."; exit 100; fi

sudo dpkg -i mysql-community-client_5.6.21-1ubuntu12.04_amd64.deb
if [ $? != 0 ];then echo "Unable to install package mysql-community-client."; exit 100; fi

sudo mv /etc/mysql/my.cnf my.cnf.in
if [ $? != 0 ];then echo "Unable to move /etc/mysql/my.cnf."; exit 100; fi

sudo sed -e s/127.0.0.1/0.0.0.0/g my.cnf.in | sudo tee /etc/mysql/my.cnf
if [ $? != 0 ];then echo "Unable to configure my.cnf."; exit 100; fi

#sudo rm -f my.cnf.in

sudo /etc/init.d/mysql restart
if [ $? != 0 ];then echo "Unable to restart mysql server."; exit 100; fi

exit 0

# Leave the last line empty, otherwise it can cause problems running the script

最佳答案

问候我还没有尝试过,但几周前我看到了这个图:

https://serversforhackers.com/video/installing-mysql-with-debconf

关于mysql - AWS Ubuntu 14.04 上的无人值守 MySQL 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31144262/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com