If you have ever tried to move a website, and more specifically your MySQL database, you may have seen this error before. These can be frustrating and time-consuming. Here is a quick fix though!
- Make a backup copy of the SQL file you want to import.
- Open the SQL file with a text editor, such as Notepad++, Sublime, or your favorite editor.
- Search for strings that are CREATE DATABASE %Database name% or USE %Database name%. %DatabaseName% is a placeholder for the actual database name in your SQL file.
- Delete these commands. Be careful not to inadvertently remove other statements.
- Save your changes.
This should get you back on track quickly so you can get your site running smoothly again.