Database Management
This page explains how to manage MySQL and MariaDB databases on your Linux server — via the command line, phpMyAdmin, Plesk or cPanel. It lists the most important SQL commands and links to step-by-step guides such as resetting the root password.
MySQL & MariaDB — The Basics
MySQL and MariaDB are the most widely used relational database systems for web servers. MariaDB is a largely compatible fork of MySQL and is the default database on Debian and many other Linux distributions. Most commands and concepts are identical between both systems.
mysql client for full control over your databases.Useful Commands at a Glance
The most common MySQL administration tasks can be handled with just a few commands:
| Task | Command |
|---|---|
| Log in as root | mysql -u root -p |
| List all databases | SHOW DATABASES; |
| Create a database | CREATE DATABASE mydatabase; |
| Create a user | CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; |
| Grant permissions | GRANT ALL ON db.* TO 'user'@'localhost'; |
| Export database (backup) | mysqldump -u root -p dbname > backup.sql |
| Import database | mysql -u root -p dbname < backup.sql |
Available Guides
Detailed step-by-step guides for common database tasks:
Regular backups are essential. Back up your databases regularly using mysqldump or a dedicated backup tool like Acronis. A database failure without a recent backup can result in complete data loss.
Further Documentation
For advanced database administration, refer to the official documentation for each system.