Skip to content

Instantly share code, notes, and snippets.

@websmith
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save websmith/b5a2ef78d5dd6eecb7bc to your computer and use it in GitHub Desktop.
Save websmith/b5a2ef78d5dd6eecb7bc to your computer and use it in GitHub Desktop.
Installs parts required for Wordpress install and sets up the database
echo -e '\E[1;33;44m' "Install php mysql and apache services"; tput sgr0
parts install php5 php5-apache2 php5-pdo-mysql php5-zlib mysql
echo -e '\E[1;33;44m' "Start the apache and mysql services"; tput sgr0
parts start apache2 mysql
echo -e '\E[1;33;44m' "Create the MySQL database that WP will use"; tput sgr0
# This script uses the default password 'password' - IT IS NOT SECURE!
echo "CREATE DATABASE wordpress;" > msqlcmds.txt
echo "USE wordpress;" >> msqlcmds.txt
echo "CREATE USER wordpressuser@localhost;" >> msqlcmds.txt
# note escaped quotes on line below
echo "SET PASSWORD FOR wordpressuser@localhost= PASSWORD(\"password\");" >> msqlcmds.txt
######################## wordpressuser ########
echo "GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';" >> msqlcmds.txt
######################## wordpressuser ########
echo "FLUSH PRIVILEGES;" >> msqlcmds.txt
echo "exit" >> msqlcmds.txt
echo The password for the MySQL server is blank!
echo You should change it after instalation.
echo -
echo For now - Just press the enter key to enter the blank password
mysql -u root -p < msqlcmds.txt -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment