MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Being a fork of a leading open source software system, it is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle.
🧑🎓 Guide Setup - DigitalOcean
apt-get install mariadb-server
⚙️ MariaDB Configuration File : The configuration file is where the MariaDB server reads its settings.
🗃️ List of options of the Config File
Location depends on the system, but it is usually located at /etc/mysql/my.cnf
. For MariaDB server, the configuration file is /etc/mysql/mariadb.conf.d/50-server.cnf
.
datadir
: The directory where MariaDB stores its data.pid-file
: The file where the server writes the process ID.socket
: The Unix socket file that the server uses for communication with local clients.user
: The MariaDB user that the server runs as.port
: The port number on which the server listens for TCP/IP connections.bind-address
: The IP address to bind to.
[mysqld]
datadir=/var/lib/mysql
socket=/run/mysql/mysql.sock
pid-file=/run/mysql/mysql.pid
user=root
port=3306 # Default port
bind-address= 0.0.0.0 # Listen to all interfaces
Setup the database with user and password.
-- Create database
CREATE DATABASE IF NOT EXISTS <database>;
-- Create user and grant privileges
CREATE USER IF NOT EXISTS '<user>'@'<host>' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON <database>.* TO '<user>'@'<host>' IDENTIFIED BY '<password>';
-- Change password of a user
ALTER USER '<root_user>'@'<host>' IDENTIFIED BY '<root_password>';
-- Flush privileges
FLUSH PRIVILEGES;