phpMyadmin 数据库导入错误 #1046 - 未选择数据库

2022-01-05 00:00:00 import database mysql phpmyadmin

我有一个 sql 文件,是从另一台计算机上的 phpmyadmin 导出的.我试图在这台计算机上导入文件,但出现此错误:

I have an sql file that i exported from phpmyadmin on another computer. I tried to import the file on this computer and I get this error:

Error

SQL 查询:

--
-- Database: `phplogin`
--
-- --------------------------------------------------------
--
-- Table structure for table `people`
--
CREATE TABLE IF NOT EXISTS  `people` (

 `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
 `name` VARCHAR( 25 ) NOT NULL ,
 `age` INT( 11 ) NOT NULL ,
 `testvar` VARCHAR( 5 ) NOT NULL ,
PRIMARY KEY (  `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =3;

MySQL said: 

#1046 - No database selected 

推荐答案

错误是因为您没有在左侧选择要导入的数据库,和/或您没有先创建空数据库.在phpMyAdmin中创建一个名为phplogin"的数据库,在左侧选择它,然后运行导入.

The error is because you either didn't select a database on the left side to import to, and/or you didn't create the empty database first. Create a database in phpMyAdmin called "phplogin", select it on the left side, and then run the import.

相关文章