Project

General

Profile

Support #945

Install MariaDB 10 on Arch Linux

Added by Daniel Curtis almost 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database Server
Target version:
Start date:
01/06/2019
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

This is a simple guide on setting up a MariaDB 10 server on Arch Linux.

Prepare the Environment

  • Make sure the system is up to date:
    pacman -Syu
    

Install MariaDB server

  • Start by installing the mariadb server and mariadb-clients packages:
    pacman -S mariadb{,-clients}
    
  • Initialize the database:
    mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
    
  • Enable and start MariaDB
    systemctl enable mariadb
    systemctl start mariadb
    
  • Prepare the database for use by running the secure installation:
    mysql_secure_installation
    
    • NOTE: Choose a strong root password and answer yes to all questions.

Create MariaDB Databases and Users

  • Login to MariaDB and create appropriate databases and users.
    mysql -u root -p
    
    • and run the following SQL queries to create the somedb database and someuser user:
      CREATE DATABASE somedb CHARACTER SET utf8;
      
      CREATE USER 'someuser'@'localhost' IDENTIFIED BY 'SuperSecretPassword';
      
      GRANT ALL PRIVILEGES ON somedb.* TO 'someuser'@'localhost';
      
      FLUSH PRIVILEGES;
      
      quit
      

Also available in: Atom PDF