0

I'm dealing with this problem in my MYSQL database for several hours now. I work with OS X 10.8.4 and use the tool Sequel Pro to work with my database. The table I have troubles with looks like this:

CREATE TABLE `Descriptions` (  

  `id` int(11) unsigned zerofill NOT NULL AUTO_INCREMENT,  
`company` varchar(200) DEFAULT NULL,  
`overview` mediumtext,    
`trade` mediumtext,  
PRIMARY KEY (`id`))  
 ENGINE=InnoDB AUTO_INCREMENT=1703911 DEFAULT CHARSET=utf8;  

I imported a csv file like this:

LOAD DATA LOCAL INFILE 'users/marc/desktop/descriptions kopie.txt'
INTO TABLE descriptions  
FIELDS TERMINATED BY ';'  
LINES TERMINATED BY '\n'  
(@dummy, company, overview, trade)  

When I look at the data in my table now, everything looks the way I expect (SELECT * Syntax). But I can't work with the data. When I try to select the company 'SISTERS', from which I know that it exists, it gives me no results. Also the fields "overview" and "trade" are not NULL when there's no data, it is just an empty string. The other tables in the database works just fine with the imported data. Somehow MySQL just doesn't see the values as something to work with, it doesn't bothers to read them.

What I tried so far:
- I used text wrangler to convert the csv to txt (utf-8) and loadet it into the database, did not work
- I changed the fields into BLOB and back to varchar/mediumtext to force mysql to do something with the data, did not work
- I tried to use the Sequel Pro Import function, did not change anything
- I tried to make a new table and copy the old one into it, did not change anything
- I tried to force mysql to change the values by using the concat syntax (just adding random variables which I could delete later again)

Could it have something to do with the collation settings? Could it has something to do with my regional settings (Switzerland) on my OS X) Any other ideas? I would appreciate any help very much.

Kind Regards,
Marc

4

1 回答 1

0

我可以解决问题。当我在 Text Wrangler 中打开 csv 并让看不见的字符显示时,它充满了红色的反向问号。那些狡猾的混蛋,他们把一切都搞砸了。我现在不知道它们是什么,但它们是问题所在。我使用“Zap Gremlins...”选项删除了它们。

于 2013-08-29T21:02:43.100 回答