CloudPanel provides straightforward tools for managing your databases:
📌 Creating a Database:
- Click on "Add Database".
- Enter your Database Name, Database User Name, and Password.
- Click "Add Database".
📌 Deleting a Database:
- Click on "Delete" next to the database.
- Confirm the action.
📌 Managing Database Users:
- Adding a User:
[LIST] - Click on "Add Database User".
- Enter User Name, Password, select the Database, and set Permissions.
[*]
Deleting a User:- Click "Delete" next to the user and confirm.
[/LIST]
📌 phpMyAdmin:
- Click "Manage" to access your database via phpMyAdmin.
⚠️ Attention:
Avoid using phpMyAdmin for exporting/importing databases, as it can lead to corruption or data loss. Instead, use CloudPanel's built-in commands as explained below.
📌 Exporting Databases (Recommended Method):
Export your database safely via SSH using mysqldump:
- Login via SSH:
CODE_BLOCK_0 - Navigate to your preferred backup directory, e.g.:
CODE_BLOCK_1 - Export the database (compressed/uncompressed):
# Compressed (.gz)
clpctl db:export --databaseName=my-database --file=dump.sql.gz
# Uncompressed
CODE_BLOCK_3
📌 Importing Databases:
Use CloudPanel’s built-in import tool via SSH:
- Login via SSH:
CODE_BLOCK_4 - Go to your database dump directory and run:
CODE_BLOCK_5
📌 Automatic Database Backups:
CloudPanel automatically creates database backups every night at
3:15 AM, keeping them for
7 days.
- Backup location:
CODE_BLOCK_6 - To adjust backup frequency or retention:
[LIST=1] - Login via SSH as root:
CODE_BLOCK_7 - Edit the cron job:
CODE_BLOCK_8 - Modify schedule or retention:
# Default schedule (daily at 03:15 AM)
CODE_BLOCK_9
[/LIST]
📌 Database Master Credentials:
- To view your master database credentials:
- CODE_BLOCK_10
📌 Remote Database Access:
- If you need remote access, go to the Firewall section in CloudPanel's Admin Area and whitelist your IP address for MySQL port 3306.
This setup ensures secure, reliable, and convenient database management with CloudPanel.