Lee
Lee

Reputation: 11

Keep getting this error when importing MySQL to phpMyAdmin

Can anyone tell me where I screwed up here? I keep getting this error message:

--
-- Database: `lehili`
--
-- --------------------------------------------------------
--
-- Table structure for table `wp_cb_contact_form`
--
CREATE TABLE IF NOT EXISTS `wp_cb_contact_form` (
  `form_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
  `form_name` varchar( 200 ) NOT NULL ,
  PRIMARY KEY ( `form_id` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =3;

MySQL said:

#1046 - No database selected 

Upvotes: 1

Views: 283

Answers (2)

Sourabh
Sourabh

Reputation: 500

Please do following

  1. Create database 'lehili' in phpmyadmin.
  2. Select that database (make sure that it has no tables).
  3. Click on the 'Import' menu item.
  4. Select the file you have to import.

Now you shouldn't be getting any errors

Upvotes: 0

SaidbakR
SaidbakR

Reputation: 13534

The meaning of selecting a database in phpMyAdmin is to click on the database name from the left pan as demonstrated in the following screen shot:

enter image description here

As shown from your dump code, the database name is a comment for just as reference.

So you have to create an empty new database, if you are not already have one, and import the dump code you have. Don't forget to set suitable collation for the new database, I prefer utf8_general_ci.

Upvotes: 1

Related Questions