Skip to content

Commit

Permalink
Merge pull request #6 from basilhendroff/mariadb-10.3
Browse files Browse the repository at this point in the history
Update wordpress-jail.sh
  • Loading branch information
basilhendroff committed Oct 25, 2020
2 parents d96150e + f5914fc commit f85540a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wordpress-jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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='';"
Expand Down

0 comments on commit f85540a

Please sign in to comment.