Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error #1046 - No database selected SQL import on XAMPP

I am trying to import the SQL database from my Drupal production site into a sandbox testing site on my local machine. I currently use XAMPP on my machine here at work.

I have downloaded my db aipiadxxm_if9DHdr.sql and then I go to the phpMyAdmin on http://localhost/phpmyadmin/index.php then to -> Import.

After I import the db I get this Error:

SQL query:
--
-- Database: `aipiadxxm_if9DHdr.sql`
--
-- --------------------------------------------------------
--
-- Table structure for table `if9d_access`
--
CREATE TABLE IF NOT EXISTS `if9d_access` (
`aid` int( 11 ) NOT NULL AUTO_INCREMENT ,
`mask` varchar( 255 ) NOT NULL default '',
`type` varchar( 255 ) NOT NULL default '',
`status` tinyint( 4 ) NOT NULL default '0',
PRIMARY KEY ( `aid` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;


MySQL said: Documentation
#1046 - No database selected 

What is causing this error message: #1046 - No database selected ?

like image 512
accraze Avatar asked Jul 11 '12 17:07

accraze


People also ask

What do you mean of error?

Definition of error 1a : an act or condition of ignorant or imprudent deviation from a code of behavior. b : an act involving an unintentional deviation from truth or accuracy made an error in adding up the bill.

What is the synonym of error?

Some common synonyms of error are blunder, lapse, mistake, and slip. While all these words mean "a departure from what is true, right, or proper," error suggests the existence of a standard or guide and a straying from the right course through failure to make effective use of this.

What is error with example?

The definition of an error is a mistake or the state of being wrong. An example of an error is when you add 2+2 and get 5. An example of error is when a mistake leads you to come to the wrong collusion and you continue to believe this incorrect conclusion. noun.

Whats the opposite of an error?

Antonyms. rightness correctness natural object overgarment better. incorrectness wrongness erroneousness.


1 Answers

You need to create and/or select the database on your sandbox machine before importing the SQL for the table structure and data.

In phpMyAdmin, this means choosing a database from the sidebar and then using its import tab. If the database you want to fill doesn't exist, you have to create it first using the Create new database form.

After import, you should confirm that the export-import process hasn't affected the anonymous user record (uid 0).

like image 87
scronide Avatar answered Sep 23 '22 00:09

scronide