This is an old revision of the document!
Table of Contents
Wordpresss
Introduction
WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MariaDB backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and running quickly. After setup, almost all administration can be done through the web frontend.
Step 1 — Creating a MariaDB Database and User for WordPress
The first step that we will take is a preparatory one. WordPress requires a MySQL-based database to store and manage site and user information. We have MariaDB — a drop-in replacement for MySQL — installed already, but we need to make a database and a user for WordPress to use.
To get started, open up the MariaDB prompt as the root account:
sudo mariadb
Note: If you set up another account with administrative privileges when you installed and set up MariaDB, you can also log in as that user. You’ll need to do so with the following command:
mariadb -u username -p
After issuing this command, MariaDB will prompt you for the password you set for that account.
Begin by creating a new database that WordPress will control. You can call this whatever you would like but, to keep it simple for this guide, we will name it wordpress.
Create the database for WordPress by typing:
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Note that every MySQL statement must end in a semi-colon (;). Check to make sure this is present if you are running into any issues.
Next, create a separate MySQL user account that we will use exclusively to operate on our new database. Creating single-function databases and accounts is a good idea from a management and security standpoint. We will use the name wordpress_user in this guide, but feel free to change this if you’d like.
Create this account, set a password, and grant the user access to the database you just created with the following command. Remember to choose a strong password for your database user:
GRANT ALL ON wordpress.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
You now have a database and user account, each made specifically for WordPress. Run the following command to reload the grant tables so that the current instance of MariaDB knows about the changes you’ve made:
FLUSH PRIVILEGES;
Exit out of MariaDB by typing:
EXIT;
Now that you’ve configured the database and user that will be used by WordPress, you can move on to installing some PHP-related packages used by the CMS.
