Compare commits

...

2 Commits

1 changed files with 7 additions and 5 deletions

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"