If you are using a self hosted WordPress setup it easy to install a new site with Linux.


then you can unpack it and open the site for configuration with a browser.

tar -xvf latest.tar.gz

generally a database will need to be created for the wordpress setup so its not a bad idea to use a shell script to mechanize the setup

sudo mysql -u root -p

Then enter your database password and you will have local host access to the database.

Now each web site will need a user account and password. Ideally the password can be generated which makes hacking almost impossible., Keep in mind all SQL commands end with the semicolon which common with many programming languages.

CREATE DATABASE databasename;

WIth the database created then user access be added. The % means anybody anywhere on the internet with the credentials can use the database. This is why the password needs to be very long and strong. Remember that the single quotes are needed as this is part of the SQL syntax.

CREATE USER ‘username’@’%’ IDENTIFIED BY ‘password’;

By hard coding permissions to the web site means nobody is going to be able to use a SQL injection attack.

GRANT ALL  ON *.* TO ‘siteuser’@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

It’s possible that a warning will be displayed, but the grant will be OK. This seems to be a bug with Ubuntu 16.04.


The flush simply tells MySQL to reload all the new changes.

SHOW GRANTS FOR ‘user’@’%’;

will show that the user account permissions are as expected,