๐ŸฌCreate database on Mariadb

  1. Once we have finished with the installation of mariadb we must create the database and the user for the WordPress. First we must access mariadb with ne command:

mariadb
  1. We create a database for the WordPress. In my case I'm going to call it wp_database. I will do all this with the command:

CREATE DATABASE wp_database;
  1. To make sure that the database for WordPress has been created we can view all existing databases with the command:

SHOW DATABASES;
  1. Next we need to create a user inside the database. We will use the command:

 CREATE USER 'gemartin'@'localhost' IDENTIFIED BY '12345';
  1. We bind the new user to our database so that we grant him the necessary permissions to be able to work. We will use the command:

GRANT ALL PRIVILEGES ON wp_database.* TO 'gemartin'@'localhost';
  1. We update the permissions for the changes to take effect with the command:

FLUSH PRIVILEGES;
  1. Once we have completed the previous step, we can exit mariadb:

exit

Last updated

Was this helpful?