Problems with character_sets/collations when importing data
Posted by: john d. herron
Date: August 25, 2010 08:32PM

Just created a database and a table to test character set and collation handling.
Working with mixed French- and Italian-language (ISO 8859-1 or cp1252) data.

Linguistically, the database is configured thus:
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+--------------------------+----------------------------+

Successfully tried SET NAMES to change collation_connection and collation_database to latin1_general_cs; but attempting to do the same for collation_server (in my.cnf) has so far not worked.
Looks like adding

# * Character-set settings
#
collation_server=latin1_general_cs
character_set_server=latin1

in the [mysqld] section is not catching on.

Importing a latin1 (cp4...) csv test file via LOAD DATA INFILE resulted in a table where all of the accented characters are mangled.

Could the affected three fields of the table perhaps be 'saved' by applying some SELECT CONVERT magic?

The server is a Debian (Ubuntu) 5.0.51 vintage.

Any help will be appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
Problems with character_sets/collations when importing data
3320
August 25, 2010 08:32PM


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.