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

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

Moderator: severin

Post Reply
Posts: 1
Joined: Thu 24. Mar 2011, 03:32

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

Post by wpdesigner » Thu 24. Mar 2011, 03:48

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 31. Mar 2011, 22:53

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

Post by monkeysports » Thu 31. Mar 2011, 22:56

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.


Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests