If you’d like to install WordPress on your cloud server, one of the easiest approaches is to work in shell. In this article we’ll explain how to:
- Create a new database in MYSQL
- Download the latest WordPress package using WGET and TAR
Later, in another post, I’ll cover actually installing WordPress. The first step is to create a new database. To do this, first log into your server via shell. If you are on a remote computer , I recommend using Putty.
Once logged into shell it will be necessary to log into MYSQL. I use the mysql command with the root user as follows:
Breaking this command down, I entered ‘sudo’ so the system recognizes me as an administrator for this command, then mysql. -u is to indicate the next string is a user and -p indicates it should prompt me for a password.
The entire exchange looks like this:
user@Poseidon:~$ sudo mysql -u root -p
[sudo] password for user:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 37855
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input s
Once successfully logged into the database there are only two things to do:
- Create a new database
- Create a new user with rights to the database
The first step, creating a new user is accomplished using the CREATE DATABASE command. The syntax is as follows:
For instructions on how to create the new user with rights to the database, please reference our previous post on this topic:
ADDING DATABASE USERS TO AN EXISTING MYSQL DATABASE
The next step is to download and unzip a fresh copy of the WordPress code base. In order to do this we will first create a folder for the new site on the server and then download the files:
cd new directory
tar -xzvf latest.tar.gz
The WordPress package will extract into a folder called wordpress in the same directory that you downloaded latest.tar.gz.