Tag Archives: mysql

Installing WordPress (CheatSheet)

Published / by MasonCloud / Leave a Comment
#!/bin/bash -xe

#sleep 6000m;

date "+%Y-%m-%d %H:%M:%S"
sudo yum update -y -q
sudo yum install httpd -y -q
sudo service httpd start
sudo chkconfig httpd on
sudo yum install mysql php php-mysql php-gd wget nano htop -y -q
sudo wget --quiet http://wordpress.org/latest.tar.gz -O /tmp/latest.tar.gz
sudo tar -zxf /tmp/latest.tar.gz -C /tmp/
sudo sudo rsync -aqP /tmp/wordpress/ /var/www/html/
sudo mkdir /var/www/html/wp-content/uploads
sudo mv /home/ec2-user/wp-config.php /var/www/html/
sudo chown -R apache:apache /var/www/html/*
exit 0
$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
    -> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT