MariaDB Installation - LeandroTheDev/arch_linux GitHub Wiki

Update the System

sudo pacman -Syu

Install the MySQL

sudo pacman -S mysql

Use the MariaDB

Verify

mariadbd --version

Install configurations

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Configure the system to start, and start on boot

sudo systemctl start mysqld

systemctl enable mysqld

Configure users

First

  • sudo mysql

Create a user

  • CREATE USER 'username'@'%' IDENTIFIED BY 'password';
  • "%" means that all ip's is allowed to login with this credentials

Create a database

  • CREATE DATABASE 'yourDB';

Give privilegies to that database

  • GRANT ALL PRIVILEGES ON yourDB.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

To a specific ip

  • "GRANT ALL PRIVILEGES ON . TO 'username'@'127.0.0.1' IDENTIFIED BY 'password' WITH GRANT OPTION;"