How to Recover Deleted Database MySQL?

Learn how to recover deleted database MySQL and recover permanently deleted files in Windows 10/11 via the corresponding methods on this page. Meanwhile, you can get related data loss prevention tips.

Penny

By Penny / Updated on April 2, 2024

Share this: instagram reddit

Can you recover a deleted MySQL database?

MySQL is an open-source relational database management system (RDBMS). Besides relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer’s storage system, manage users, allow network access, facilitates testing database integrity and backup creation.

mysql

Since MySQL is essential to careers, are you working to recover MySQL database after deletion?

   
   
   
       

I accidentally deleted a MySQL database on my server. So is there any way to recover deleted database MySQL? Any suggestions will be appreciated.

- A user from StackExchange

Fortunately, prepared backups provide a possibility for you to restore MySQL databases.

The mysqldump command is designed to back up single/multiple/all MySQL databases as you prefer. Apart from that, mysqldump can be run directly from a DOS command window without logging into the database.

3 ways to recover deleted database MySQL

But how exactly do you recover MySQL database? You can refer to one of the following approaches after getting an overview of them.

Solution 1. Backup and restore MySQL database from MySQL Workbench

If you’ve created database backups before, you can get MySQL dump files. This is one of the ways. Let’s perform how to restore MySQL from your dump files.

Step 1. Run your MySQL Workbench and connect your MySQL Server.

Step 2. Click “Data Import/Restore” on the left. You can also choose “Data Import” under the Server tab.

data-import-mysql-workbench

Step 3. Click the “Import from Self-Contained File” button. Then choose the default target schema and select database objects to import.

choose-mysql-dump-file-workbench

Step 4. Click the “Start Import” button.

mysql-start-export

After the restoration process, you’ll get your needed MySQL database.

mysql-import-finished-workbench

Solution 2. Recover deleted database MySQL using CMD

As mentioned above, CMD also can recover MySQL databases. Please get an overview of some common parameters before recovering deleted files using CMD.   

Notes:✎...   
-u: A username that connects to a MySQL Server.
-p: The password for the username you use to log in and connect to the Server.   
tbname: The name of an empty database that you want to load data from the backup file.
<: A parameter that refers to the process of a database restoration.   
filename. sql: The path of the dump file.
–database: At least, one database name must be specified. If there’re multiple databases, they must be separated by spaces.
–all databases: All databases are backed up.

For instance, if you need to restore a MySQL database named mysql from the mysql. sql file, you can enter “mysql –u –root –p mysql” in the command prompt window.

restore-single-mysql-database-cmd

If you want to restore MySQL databases in MySQL Shell, please type “mysql –u root –p mysql” in the window.

mysql-restore-database-mysql-shell

Solution 3. Recover deleted database MySQL via phpMyAdmin

phpMyAdmin is a free and open-source MySQL and MariaDB administration tool. As a portable web application written primarily in HPF, phyMyAdmin has become one of the most popular MySQL administration utilities, especially for web hosting services.

Please refer to the following steps to recover deleted database MySQL.

Step 1. After launching phpMyAdmin on your PC, click the “Import” button.

phpmyadmin-import

Step 2. Click “Choose File” to select your needed MySQL dump file.

phpmyadmin-choose-mysql-dump-file.

Step 3. In the Partial Import screen, select “SQL” format and click the “Go” button.

phpmyadmin-import-mysql-dump-file-go

Bonus tips: How to recover permanently deleted files in Windows 10/11?

As you can see, MySQL is only for computer experts because ordinary people may not even have access to this software. They are more exposed to Microsoft Office software.

However, deletion is unavoidable; while you’re organizing files you accidentally deleted folders or other valuable files. Getting accidentally deleted items back is relatively easy.  But some users have voiced their concerns: is it possible to recover permanently deleted files in Windows 10/11 computers without backups?

If you haven’t taken protective measures like creating regular backups before data loss, all your hard work and efforts could go in vain.

At this point, seeking help from leading data recovery software like MyRecover can be your top choice because only tools can help you eliminate the need for backups.   

★Tips:  
Powerful features: Recover deleted & lost MS Office files, folders, compressed files, photos, songs, videos, audio, websites, and hundreds of file types from HDD, USB, SD cards, etc.
Easy-to-find: During Quick Scan and Deep Scan, you can search your desired files by Path, Filename, Date, etc.
Convenient: Retain the original Path, Filename, and Format for the deleted files.   
Excellent compatibility: Support NTFS, FAT32, exFAT, and ReFS file systems.

Download MyRecover on your Windows 11, 10, 8, 7, or Windows Server computer to get your missing files back!

Download Software Windows 11/10/8/7/Server
Secure Download

Step 1. After launching MyRecover, hover the mouse over the partition that stores your desired files before data loss. Then click Scan.

select-location-to-scan

Step 2. You can quickly locate your desired files according to Name, Path, Date, or Type or wait to view all the deleted & lost files after the scanning process.

scanning-drive

Step 3. Go to the Deleted Files/Recycle Bin/Other Missing Files folder and click “Recover x files” to recover missing files. Please remember to store these files in a new location.

select-deleted-word-files-click-recover

Wrapping up

How to recover deleted database MySQL? How to recover permanently deleted files in Windows 10/11 without backups? You can get the corresponding solutions after reading this article.

Backups are critical and cannot be overstated. So why not use this free backup software for Windows, AOMEI Backupper to back up files, folders, partitions, disks, or systems? Besides, incremental and differential backups are also accessible to you using this tool.

Penny
Penny · Editor
Penny works as an editor at AOMEI Technology, while she's a tester and editor for AOMEI Data Recovery Tools. She enjoys helping users with data recovery issues on Windows and iPhones using simple and practical solutions. Outside of work, she has a strong affection for pets, particularly giant pandas.