Mobile app version of vmapp.org
Login or Join
Cooney921

: How do I solve this error when importing MySQL databases into phpMyAdmin? As part of a system rebuild of my local machine, I have exported all of my MySQL databases using the Export tab in

@Cooney921

Posted in: #Mysql #Phpmyadmin

As part of a system rebuild of my local machine, I have exported all of my MySQL databases using the Export tab in phpMyAdmin. The result is one large file containing each database and their respective tables.

My setup is a MacBook running MAMP 3 Pro

Upon trying to restore the databases, I am running into a problem where phpMyAdmin seems to want the each of the databases to be created first. A typical error message is:



Error
SQL query:

-- Database: myfirstdatabase

1046 - No database selected



I have clearly gone about backing up my databases in the wrong way, but is there a method for easily recovering from this situation?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

1 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay111

When exporting, phpmyadmin has an option (under the "custom" configuration) to "CREATE DATABASE / USE statement". If you didn't check that, then your export file won't create the databases.

As far as recovering, you'll need to create each database manually. Not the tables and schemas though, just create the database itself and your existing default export format should create the tables for you.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme