VPS1Euro Dashboard Wiki

Complete client guide: infrastructure, services, account and support.

FR EN

Install and configure MariaDB (database)

Manage MySQL/MariaDB databases: creation, users, rights and optimization.

What this tutorial does

The tutorial "Install and configure MariaDB (database)" helps you achieve this goal:

Manage MySQL/MariaDB databases: creation, users, rights and optimization.

← Back to tutorials
1 profiles 22 steps 9 commands ~25 min

Debian/Ubuntu

  1. Install MariaDB: apt install -y mariadb-server mariadb-client
  2. Secure the installation: mysql_secure_installation
  3. --- Log in ---
  4. mysql -u root -p
  5. --- Database management ---
  6. List the bases: SHOW DATABASES;
  7. Create a database: CREATE DATABASE mybase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  8. Delete a base: DROP DATABASE mybase;
  9. --- User management ---
  10. Create a user: CREATE USER "myuser"@"localhost" IDENTIFIED BY "password";
  11. Grant all rights: GRANT ALL PRIVILEGES ON mybase.* TO "monuser"@"localhost";
  12. Read-only rights: GRANT SELECT ON mybase.* TO "reader"@"localhost";
  13. Apply rights: FLUSH PRIVILEGES;
  14. List users: SELECT user, host FROM mysql.user;
  15. --- Import/Export ---
  16. Export: mysqldump -u root -p mabase > mabase.sql
  17. Import: mysql -u root -p mabase < mabase.sql
  18. --- Basic optimization ---
  19. Edit /etc/mysql/mariadb.conf.d/50-server.cnf:
  20. innodb_buffer_pool_size = 256M (adjust based on available RAM)
  21. query_cache_size = 64M
  22. Restart: systemctl restart mariadb