Hi all,

First of all, sorry for the lengthy subject, but it serves to describe
my problem:

I'm having problems entering Portuguese accented characters (with a
Portuguese keyboard) in "MySQL monitor" (MySQL command line / console
client), when I'm in a SSH (Secure Shell) Session, in a Linux Server
configured to use Unicode (UTF-8 encoding).

I'm using "dead keys" - http://en.wikipedia.org/wiki/Dead_key - to
enter the accented characters. That is, if I press the ã (tilde sign)
key on my keyboard and then press "a" (lowercase a) then I get "ã"
(lowercase a with tilde accent).

This is a sample output from a SSH session, from a computer running
"putty" version 0.60 (in Windows XP Professional with Service Pack 2)
to my Linux Server (Suse Linux Enterprise Server 10 - aka SLES 10),
located in the same LAN:

# whoami
root

# echo "Áá Ãã Çç"
Áá Ãã Çç

[ Great... Portuguese characters seem to be working well so far, both
in the input and in output. Now, I'll enter the mysql console: ]

# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.41-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

[ OK... Let me try to enter one lowercase ã - "a" with tilde accent ]

mysql> #


Now, you may be wondering why I'm getting that "hash" sign instead of
"ã" (lower case a with tilde) ... I'm wondering the same thing!  ;-)

The funny thing is that if I try to type other accented characters, in
this "mysql" console, it does NOT display ANY character!


Here's the output of \s  (status):

mysql> \s
--------------
mysql  Ver 14.12 Distrib 5.0.41, for pc-linux-gnu (i686) using readline 5.0

Connection id:          5
Current database:
Current user:           [EMAIL PROTECTED]
SSL:                    Not in use
Current pager:          less
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.41-community MySQL Community Edition (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 1 hour 40 min 38 sec


And here's the output of the character set variables:

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)


I also tried to change all the character sets to utf8 by changing the
/etc/my.cnf file (by setting default-character-set=utf8 in the
[client] and [mysqld] sections of that file). That DID change all
these character_set variables to utf8, but it did NOT solve my
accented characters problem.

If I log in the to local console (the one that is PHYSICALLY connected
to the server) and I enter the mysql console, all the characters
appear correctly. But, if in that same local console, I do a ssh
127.0.0.1 (to create a ssh connection to that same machine) I get
AGAIN the same problem with the accented characters in the mysql
console (commands entered outside the mysql console DO appear
correctly).

So, I'm guessing this is NOT a problem with putty (I also tried to use
SecureCRT, also set to UTF8, with the same results), but that it is
instead some kind of missing or wrong configuration of mysql (Server
and/or Client) and/or some other variable that I must set in the SSH
daemon (sshd)  in /etc/ssh/sshd_config

By the way, this is the output of my locale command in the SSH session:

# locale
LANG=pt_PT.UTF-8
LC_CTYPE=pt_PT.UTF-8
LC_NUMERIC="pt_PT.UTF-8"
LC_TIME="pt_PT.UTF-8"
LC_COLLATE=POSIX
LC_MONETARY="pt_PT.UTF-8"
LC_MESSAGES="pt_PT.UTF-8"
LC_PAPER="pt_PT.UTF-8"
LC_NAME="pt_PT.UTF-8"
LC_ADDRESS="pt_PT.UTF-8"
LC_TELEPHONE="pt_PT.UTF-8"
LC_MEASUREMENT="pt_PT.UTF-8"
LC_IDENTIFICATION="pt_PT.UTF-8"
LC_ALL=


My sshd_config file DOES have the following lines, at the end:

AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL


The SSH Daemon of the Linux Server is running OpenSSH. The OpenSSH
version is "OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005"


Any tips or information... please?  :)

Thanks in advance!

Best wishes,
Ricardo Dias Marques
newsgroup DOT posts AT gmail DOT com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to