How to empty a MySQL database
- Category : MySQL Question
- Posted on : Aug 18, 2021
- Views : 1,003
- By : HostSEO
There are two ways to empty a MySQL database: via phpMyAdmin and SSH.
NOTE 1: By default, SSH access is disabled on all our shared servers. If you need SSH to be enabled, contact our Hosting support via Live Chat or submit a ticket to the Hosting department.
NOTE 2: We recommend making a backup of your database before proceeding with any changes.
Using phpMyAdmin
To empty a database follow these steps:
2. Select the database you wish to empty. A list with all the database tables will appear on the left (you may have just one database if only one website is hosted):
3. Tick Check All to select all tables and choose the Drop option from the With selected drop-down list:
4. This will execute the DROP TABLE SQL query to empty all the tables at once. On the next step, confirm you wish to proceed by clicking the Yes button:
Using SSH
When you have a large database, it can be quicker to drop the database via SSH:
1. First, check if the database user has the privileges to Drop and Create. Go to cPanel > Databases section > MySQL Databases menu:
2. Find the database you wish to drop and click the assigned username:
3. You will see what privileges this user has. Make sure Drop and Create options are selected.
If these options are not ticked, select them and click Make Changes:
3. Connect to the hosting account via SSH. You can find the detailed instructions here.
4. Once connected, run the following command:
mysql -uUsername -pPassword
where:
Username - the MySQL user assigned to the database you are working with.
Password - password for the MySQL user.
5. You should receive the following output:
6. To drop the database run this command:
drop database database_name
where database_name is the name of your database:
That's it!
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu