MySQL

MariaDB is the default implementation of MySQL in Condres OS, provided with the mariadb package.

Alternative implementations are:

  • Oracle MySQL — An implementation by Oracle Corporation.
https://www.mysql.com/ || mysqlAUR
  • Percona Server — An implementation by Percona LLC.
http://www.percona.com/software/percona-server/ || percona-server

Tip: If the database (in /var/lib/mysql) resides on a Btrfs file system, you should consider disabling Copy-on-Write for the directory before creating any database. If the database resides on a ZFS file system, you should consult ZFS#Database before creating any database.

 Install mariadb, afterwards run the following command before starting the mariadb.service:

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

Note: For security reasons, the systemd service file contains ProtectHome=true, which prevents MariaDB from accessing files under the /home/root and /run/user hierarchies. The datadir has to be in an accessible location and owned by the mysql user and group. You can modify this behavior by creating a supplementary service file as described here: https://mariadb.com/kb/en/mariadb/systemd/

 Now the mariadb.service can be started and/or enabled with systemd.

systemctl enable mariadb
systemctl start mariadb 

Tip: If you use something different from /var/lib/mysql for your data dir, you need to set datadir=<YOUR_DATADIR> under section [mysqld] of your /etc/mysql/my.cnf.

 The following command will interactively guide you through a number of recommended security measures at the database level:

mysql_secure_installation 

To simplify administration, you might want to install a front-end such as dbeavermysql-workbench, Adminer or phpMyAdmin. mysql-workbench is not completely compatible with MariaDB but can be used for basic tasks.

Calogero Scarnà
Calogero Scarnà
Articoli: 299

Newsletter

Inserisci il tuo nome e il tuo indirizzo email qui sotto e iscriviti alla nostra newsletter