Merge pull request 'Bug preventing MariaDB from starting has been fixed in 2 July.' (#1) from PippCandy/autoinstallers:master into master

Reviewed-on: https://git.codingvm.codes/snxraven/autoinstallers/pulls/1

Looks good! We will push this live
This commit is contained in:
snxraven 2022-07-03 04:17:55 +00:00
commit c8b74aeed9

View File

@ -41,11 +41,13 @@ sudo a2enmod rewrite
notif "Installing MySQL 8"
echo "Installing MySQL 8"
DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server mysql-client
echo "deb http://ports.ubuntu.com/ubuntu-ports/ jammy-proposed main universe" >> /etc/apt/sources.list
apt update
DEBIAN_FRONTEND=noninteractive apt-get -y install mariadb-server mariadb-client
echo "Starting MySQL 8"
service mysql start
service mariadb start
notif "Sleeping for 5 seconds to allow MySQL to start."
echo "Sleeping 5 seconds to allow MySQL to start"
sleep 5
@ -55,9 +57,9 @@ DBNAME=$(openssl rand -hex 12)
USERNAME=$(openssl rand -hex 12)
PASSWORD=$(openssl rand -hex 12)
mysql -uroot -e "CREATE DATABASE $DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql -uroot -e "CREATE USER $USERNAME@'127.0.0.1' IDENTIFIED BY '$PASSWORD'";
mysql -uroot -e "GRANT ALL PRIVILEGES ON $DBNAME.* TO '$USERNAME'@'127.0.0.1'";
mariadb -uroot -e "CREATE DATABASE $DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci";
mariadb -uroot -e "CREATE USER $USERNAME@'127.0.0.1' IDENTIFIED BY '$PASSWORD'";
mariadb -uroot -e "GRANT ALL PRIVILEGES ON $DBNAME.* TO '$USERNAME'@'127.0.0.1'";
notif "We have created the following Database information for this installaton: Database:$DBNAME|Username:$USERNAME|Password:$PASSWORD"