Update 'ubuntu/wp'

Back to mariadb per this launchpad comment: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634/comments/21
This commit is contained in:
PippCandy 2022-07-03 03:19:07 +00:00
parent bfc31bc1c2
commit 9bb55f06ef
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"