Verify Installation
mariadb --version
Access MariaDB Shell
As root:
mariadb -u root -p
Password is securely stored in /root/.cloudzy-creds
Connect to a Specific Database as a User
mariadb -u <username> -p -D <database> -h <host> -P <port>
-U <username>→ Database user-p→ Prompt for the user’s password-D <database>→ Database name to connect to-h <host>→ Hostname of the MariaDB server (e.g.,localhost)-P <port>→ Port (default:3306)
Common MySQL Commands
SHOW DATABASES;: List all databasesUSE DB_NAME;: Switch to a databaseSHOW TABLES;: List tables in the databaseDESCRIBE TABLE_NAME;: Show table structureSELECT * FROM TABLE_NAME;: View table dataEXIT;: Quit MySQL shell
Important Files & Directories
/root/.cloudzy-creds→ Stored database credentials/etc/mysql/→ MySQL configuration files/var/lib/mysql/→ Database data files/var/log/mysql/→ Log files
Service Management
systemctl status mariadb
systemctl restart mariadb