From f5914fcfa6014998d089b0ca9b8e73ec0cce1748 Mon Sep 17 00:00:00 2001 From: Basil Hendroff <63370329+basilhendroff@users.noreply.github.com> Date: Sun, 25 Oct 2020 18:19:07 +0800 Subject: [PATCH] Update wordpress-jail.sh Create a phpMyAdmin database to store configuration data. --- wordpress-jail.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wordpress-jail.sh b/wordpress-jail.sh index e290ee8..fafac2f 100755 --- a/wordpress-jail.sh +++ b/wordpress-jail.sh @@ -252,12 +252,16 @@ iocage exec "${JAIL_NAME}" sysrc mysql_enable="YES" iocage exec "${JAIL_NAME}" service mysql-server start ##################################################################### -print_msg "Create and secure the WordPress database..." +print_msg "Create and secure the WordPress and phpMyAdmin databases..." -# Create the database. +# Create the WordPress database. iocage exec "${JAIL_NAME}" mysql -u root -e "CREATE DATABASE wordpress;" iocage exec "${JAIL_NAME}" mysql -u root -e "GRANT ALL PRIVILEGES ON wordpress.* TO wordpress@localhost IDENTIFIED BY '${DB_PASSWORD}';" +# Create the phpMyAdmin database. +iocage exec "${JAIL_NAME}" mysql -u root -e "CREATE DATABASE phpmyadmin;" +iocage exec "${JAIL_NAME}" mysql -u root -e "GRANT ALL PRIVILEGES ON phpmyadmin.* TO wordpress@localhost IDENTIFIED BY '${DB_PASSWORD}';" + # Secure the database (equivalent of running /usr/local/bin/mysql_secure_installation) # Remove anonymous users iocage exec "${JAIL_NAME}" mysql -u root -e "DELETE FROM mysql.user WHERE User='';"