简体   繁体   English

将MySQL导入phpMyAdmin时不断出现此错误

[英]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: MySQL说:

#1046 - No database selected 

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: 在phpMyAdmin中选择数据库的意思是单击左窗格中的数据库名称,如以下屏幕截图所示:

在此处输入图片说明

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 . 不要忘记为新数据库设置合适的排序规则,我更喜欢utf8_general_ci

Please do following 请做以下

  1. Create database 'lehili' in phpmyadmin. 在phpmyadmin中创建数据库“ lehili”。
  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 现在您不应该出现任何错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM