MySQL Forums
Forum List  »  Newbie

Charset diff 5.6 to 5.7
Posted by: Thommy Malmström
Date: February 23, 2016 10:48AM

When I run the below commands on a MySQL 5.6 the data load works perfect, but on a 5.7(.11) version I get the errors as indicated. What's changed that can give this result? (Data file is the exact same)

mysql> CREATE DATABASE IF NOT EXISTS db_allCountries DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci;
Query OK, 1 row affected (0.01 sec)

mysql> use db_allCountries;
Database changed
mysql> CREATE TABLE `allCountries` (
-> `geonameid` int(11) NOT NULL,
-> `name` char(200) NOT NULL DEFAULT '',
-> `asciiname` varchar(200),
-> `alternatenames` varchar(10000),
-> `latitude` FLOAT( 10, 6 ),
-> `longitude` FLOAT( 10, 6 ),
-> `feature_class` char(1),
-> `feature_code` varchar(10),
-> `country_code` char(2),
-> `cc2` varchar(200),
-> `admin1_code` varchar(20),
-> `admin2_code` varchar(80),
-> `admin3_code` varchar(20),
-> `admin4_code` varchar(20),
-> `population` int(8),
-> `elevation` int(8),
-> `dem` int(8),
-> `timezone` varchar(40),
-> `modification_date` DATE,
-> PRIMARY KEY (`geonameid`)
-> ) ENGINE=InnoDB AUTO_INCREMENT=4080 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.28 sec)
mysql> LOAD DATA LOCAL INFILE '/home/thommym/Downloads/allCountries/allCountries.txt' INTO TABLE allCountries CHARACTER SET UTF8 FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n';
ERROR 1300 (HY000): Invalid utf8 character string: 'Afikanisitani,Apekanikana,A Phu Han (Afghanistan),A Phú Hãn (A'

Options: ReplyQuote


Subject
Written By
Posted
Charset diff 5.6 to 5.7
February 23, 2016 10:48AM
February 23, 2016 11:49AM
February 23, 2016 01:06PM
February 23, 2016 04:20PM
February 28, 2016 12:19PM
February 28, 2016 04:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.