Hi,
I'm an Austrian sysadmin living in Montpezat (South France). I'm a 100%
GNU/Linux user since 2001, and for the last two years, I've been working
as a sysadmin (that's a big word) for our "Communauté de Communes", a
group of 16 small towns and villages, where my job is mainly to install
a networked public library management system.
So far, the library management software (PMB, a webapp using a LAMP
server) is running on a Slackware Linux server, but I consider migrating
it to CentOS 5.1, the latter being more "comfortable" to manage.
Among the differences between the distributions, there's the one of the
default charset. Slackware is one of the rare distributions that's meant
to default to latin1. Accordingly, environment variables in
/etc/profile.d/lang.sh were set to something like fr_FR, or [EMAIL PROTECTED]
On CentOS, the system (when installed choosing "french") defaults to
fr_FR.UTF-8. I'd like to keep that, since changing that locale to
something like fr_FR results in various weirdnesses in system messages,
manpages and the likes.
Since my application (PMB) is really meant to run on a latin1 system, I
try to make MySQL on CentOS accordingly. I fire up my MySQL console like
this:
$ lang=fr_FR -u root -p
Here's what my database environment looks like:
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| 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/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
I fiddled around a bit and chose the example table from the tutorial,
just to test handling of special chars. I added some records containing
special characters (é, è, ô and the likes), and handling seems perfect:
mysql> select * from pet;
+----------+---------+---------+------+------------+------------+
| name | owner | species | sex | birth | death |
+----------+---------+---------+------+------------+------------+
| Fluffy | Harold | cat | f | 1993-02-04 | NULL |
| Claws | Gwen | cat | m | 1994-03-17 | NULL |
| Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
| Bowser | Diane | dog | m | 1979-08-31 | 1995-07-29 |
| Bamboù | Jérôme | dog | m | 1999-01-20 | NULL |
| Diégo | Héloïse | cat | m | 1998-01-21 | NULL |
</snip>
Now I have one remaining problem, and I don't know how to solve it. I
have a huge database dumpfile, about 100 MB of SQL instructions,
produced by PMB. The 'file' command tells me it's ISO-8859-1-encoded. I
create a test database and then try to run the dumpfile:
mysql> source /root/backup_2007_11_18.sav
But when I try to execute various select statements on my restored
database, all my french special characters have just disappeard,
"Hélène" becomes "Hlne", "Marylène" becomes "Marylne", etcetera.
Q: how can I correctly import that file on my system?
cheers from the sunny South of France,
Niki Kovacs
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]