Please direct all future questions to
MAMP PRO customers can direct their questions to
Bitte posten Sie ab jetzt Ihre Fragen bei
Unseren Support für MAMP PRO erreichen Sie unter

Error: #1046 - No database selected (Can't import DB)

Report any found bug here. We are grateful for any useful clues.

Moderator: severin

Error: #1046 - No database selected (Can't import DB)

Postby wpdesigner » Thu Mar 24, 2011 3:48 am

03/24/11 UPDATE:

I did reinstall MAMP and I was able to alter this error. Because I am new at DB issues, it's hard to know where (or how often) I erred. There were several frustrating things going on causing multiple errors. Regarding just the database import; I believe that I was not actually selected on the newly created DB at my host provider when I tried to import. This certainly simplifies the message "No database selected."

Prior to uploading/importing the existing database, I also Search and Replaced all soon to be invalid pointing ('http://localhost' --> '')

This enabled a smooth transition from the local version of Wordpress to the live version.


I've been struggling with this problem for about 7 days now; I'm not seeing others here with this same error, but here goes.

1.) I developed/customized a Wordpress site locally by using MAMP. I am on MAC OSX v. 10.5.8. All was fine and lovely during the development period. I printed out and studied several step-by-step guides of how to move the site from its local environment to a hosted server (the live domain).

2.) These steps have now been accomplished EXCEPT a successful import of the database that was created using MAMP's MyPHP interface. I have even switched host providers! Both host providers -- while trying to import the database in their MyPHP interface -- comes back with the exact same error, see below:


SQL query:

-- Database: `wp-runecast`
-- --------------------------------------------------------
-- Table structure for table `wp_commentmeta`
DROP TABLE IF EXISTS `wp_commentmeta` ;

MySQL said: Documentation
#1046 - No database selected

I have exported from the MAMP MyPHP app in at least 5-7 different ways (do DROP tables, do NOT drop tables, selected checkboxes recommended in the WP Codex as well as the Hostgator support notes); each way ends up with the same result, the above #1046 error.

It seems that something is happening on my end, but I do not know how to test it or correct it.

If upgrading to MAMP Pro would solve this problem, I would do it in a flash.

Please help. I'm very tired and out of sorts.
Posts: 1
Joined: Thu Mar 24, 2011 3:32 am

Re: Error: #1046 - No database selected (Can't import DB)

Postby monkeysports » Thu Mar 31, 2011 10:56 pm

Can you please clarify what you mean by "I believe that I was not actually selected on the newly created DB at my host provider when I tried to import." I am having this same problem importing a DB into MAMP (I started building my site on the live server, then decided I wanted to build offline first, and I want to import the work I've already done). It sounds like you solved this problem, so if you could outline how you accomplished that, it would be very helpful.

Posts: 1
Joined: Thu Mar 31, 2011 10:53 pm

Return to Bugs

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 3 guests