Skip to main content

MySQL

Install MariaDB

MariaDB is a MySQL fork and the preferred MySQL software. Run the following commands to quickly install it.

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo apt install -y mariadb-server

Create User & Database

Logging In

After installing you want to login to the MySQL command line where we will be executing statements to get things setup. To do so, simply run the command below and provide the Root MySQL account's password that you setup when installing MySQL. If you do not remember doing this, chances are you can just hit enter as no password is set.

mysql -u root -p

Creating User

Next, we will create a user called pelican and allow logins from localhost which prevents any external connections to our database. You can also use % as a wildcard or enter a numeric IP. We will also set the account password to somePassword.

CREATE USER 'pelican'@'127.0.0.1' IDENTIFIED BY 'somePassword';

Creating Database

Next, we need to create a database for the panel. In this tutorial we will be naming the database panel, but you can substitute that for whatever name you wish.

CREATE DATABASE panel;

Assigning Permissions

Finally, we need to tell MySQL that our pelican user should have access to the panel database. To do this, simply run the command below.

GRANT ALL PRIVILEGES ON panel.* TO 'pelican'@'127.0.0.1';

Setup Pelican for MySQL

After you created the user and database you can run the database setup command to use MySQL for Pelican.

cd /var/www/pelican
php artisan p:environment:database