In order to install mariadb on your linux distribution, you need to open a terminal and type “sudo apt install mariadb-server”.
jill@VM-00:~$ sudo apt install mariadb-server
MariaDB server Linux
After Mariadb server is installed, just type “sudo mysql” to login to the database server.
The “sudo mysql” command gives you access to Mariadb database server from localhost with no password.
jill@VM-00:~$ sudo mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 75 Server version: 10.5.11-MariaDB-1 Debian 11 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
The next steps are :
- Create a database
MariaDB [(none)]> create database wpdata -> ; Query OK, 1 row affected (0.000 sec) MariaDB [(none)]> show databases -> ; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | wpdata | +--------------------+ 4 rows in set (0.000 sec)
MariaDB [(none)]>
- Create a user with password
MariaDB [(none)]> create user 'jill'@localhost IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> select user from mysql.user -> ; +-------------+ | User | +-------------+ | jill | | mariadb.sys | | mysql | | root | +-------------+ 4 rows in set (0.001 sec) MariaDB [(none)]>
Give the user privileges to the database that we have just created.
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'jill'@localhost IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]>