9951 explained code solutions for 126 technologies


mariadbHow to install Mariadb on Arch linux?


  1. Install Mariadb on Arch Linux using the pacman package manager:
sudo pacman -S mariadb
  1. After installation, initialize the database:
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  1. Start the MariaDB service:
sudo systemctl start mariadb
  1. Secure the installation by running the mysql_secure_installation script:
sudo mysql_secure_installation
  1. To enable MariaDB to start on boot, run:
sudo systemctl enable mariadb

Detailed explanation:

  1. sudo pacman -S mariadb: This command installs the MariaDB package from the Arch Linux repository.

  2. sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql: This command initializes the MariaDB database.

  3. sudo systemctl start mariadb: This command starts the MariaDB service.

  4. sudo mysql_secure_installation: This command runs the mysql_secure_installation script, which sets up a root password and removes anonymous users and test databases.

  5. sudo systemctl enable mariadb: This command enables MariaDB to start on boot.

Helpful links

Edit this code on GitHub