Managing Databases via SSH
Overview
In Thamara Cloud, advanced users can manage databases directly through SSH access — including deleting databases, dropping users, and managing privileges — without needing to log into cPanel.
Before proceeding, ensure you have root access or sufficient MySQL privileges, and always create a full backup first.
Tip: If you’re not comfortable using SSH, our Thamara Cloud Support Team is happy to assist you through live chat or support ticket. How to Delete a Database via SSHTo delete a database using SSH, follow these steps:Backup the database first
Run the following command in your SSH terminal (replaceusernameanddatabasewith your actual values):
mysqldump --password username_database > username_database.db
Enter your cPanel password when prompted.Connect to MySQL
mysql -u username -pVerify the database exists
SHOW DATABASES LIKE "username_database";Delete (Drop) the database
DROP DATABASE username_database;Confirm deletion
SHOW DATABASES LIKE "username_database";
The result should be an empty set — meaning the database has been successfully removed. For detailed syntax, refer to MySQL’s official DROP DATABASE documentation. How to Drop One or Multiple UsersYou can remove user accounts (and their privileges) using theDROP USERstatement.Syntax:DROP USER 'user'@'host';Example (single user):DROP USER 'snappy01'@'localhost';Example (multiple users):DROP USER 'snappy01'@'localhost', 'snappy02'@'localhost';Deleting a user will also remove all privileges associated with that account. How to Grant Privileges in MySQLTo grant permissions to a user, you must have CREATE USER and GRANT privileges.Syntax:GRANT permission1, permission2 ON database_name TO 'user'@'localhost';Example:GRANT SELECT, INSERT, DELETE ON example_db TO 'snappy02'@'localhost';This gives the usersnappy02the ability to select, insert, and delete records within theexample_dbdatabase. How to View User PrivilegesTo check a user’s assigned privileges:Syntax:SHOW GRANTS FOR 'database_user'@'localhost';Example:SHOW GRANTS FOR 'snappy02'@'localhost';Sample Output:+------------------------------------------------------------------+
| Grants for snappy02@localhost |
+------------------------------------------------------------------+
| GRANT USAGE ON . TOsnappy02@localhost|
| GRANT SELECT, INSERT, UPDATE ONexample_db.* TOsnappy02@localhost|
+------------------------------------------------------------------+Need Assistance?If you face any issue using SSH or managing MySQL users, contact our Thamara Cloud Support Team through your [Client Dashboard]() — we’re always here to help.
Updated on: 11/11/2025
Thank you!