I recently did a clean install of Linux Mint 16 Petra on my laptop.Before I wiped the old system, I did a backup of all my MySQL databases by going to the Export tab in phpMyAdmin and dumping all the databases into one file. I didn't use any compression.Now, on the new system, in phpMyAdmin, when I go to the Import tab and try to upload the SQL file, I get this error:#1046 - No database selected... Of course no database is selected, I am trying to restore them.I am not at all an expert in MySQL, I use it to support my web design projects, so I don't understand why this isn't working. It seems to me phpMyAdmin should be able to read from a file that phpMyAdmin created.How do I restore my databases from the SQL dump file that I created?
How do I restore my MySQL databases that were dumped from phpMyAdmin?
mysql
The solution I used was to search the SQL file for everywhere that this text existed:-- Database: `my_database_01`And right under it, add the following lines:CREATE DATABASE IF NOT EXISTS `my_database_01`;USE `my_database_01`;I did this for each database in the SQL dump file, and then I was able to import and restore all databases using phpMyAdmin's import command.