简体   繁体   English

导入表时未知列名

[英]Unknown Column Name when Importing Table

I have just exported a table using phpMyAdmin and I have tried to import this table into my local database by importing the sql file I have just exported. 我刚刚使用phpMyAdmin导出了一个表,并且尝试通过导入刚导出的sql文件将该表导入到本地数据库中。 After phpMyAdmin imports 330 rows of the 15,000. 之后phpMyAdmin导入15,000的330行。 It says: 它说:

1054 - Unknown column 'font_name' in 'field list' 1054-“字段列表”中的未知列“ font_name”

How can anything go wrong, I thought it was straight forward export/import? 我认为这是直接导出/导入,怎么会出错?

I have had a look at row 330 and 331 and there isn't anything wrong within the two columns. 我看过第330行和第331行,两列中没有任何错误。

How can I narrow this down? 如何缩小范围? What is the problem likely to be? 可能是什么问题?

Thanks all for any help 谢谢大家的帮助

edit 编辑

CREATE TABLE IF NOT EXISTS `tags2` (
  `font_name` varchar(250) NOT NULL,
  `tags` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

In-fact the cause of this error message could be one of the following: 实际上,此错误消息的原因可能是以下之一:

1) phpMyAdmin issue please check the admin settings like URL and data before doing the import. 1) phpMyAdmin问题,请在导入之前检查URL和数据之类的管理员设置。 ( this is a common issue when you try to take import from the web admin phpMyAdmin ) (当您尝试从网络管理员phpMyAdmin导入时,这是一个常见问题)

if the setting is step one is correct please check point two and three 如果第一步设置正确,请检查第二点和第三点

2) the character set in database, table, or column are not matched. 2)数据库,表或列中的字符集不匹配。 so you need to do character set conversion to fix this issue. 因此您需要进行字符集转换以解决此问题。 (I guess this is the issue in your case because usually the error message appear in this case) (我想这是您遇到的问题,因为通常在这种情况下会出现错误消息)

3) privileges issue ( not so common) 3)特权问题(不太常见)

尝试使用命令行mysqldump而不是phpmyadmin

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

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