Unknown Column Name when Importing Table

2019-08-17 03:26发布

问题:

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. After phpMyAdmin imports 330 rows of the 15,000. It says:

1054 - Unknown column 'font_name' in 'field list'

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.

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;

回答1:

try a command line mysqldump instead of phpmyadmin



回答2:

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. ( this is a common issue when you try to take import from the web admin 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. 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)