1

I've got two tables in my database. And I want to see their names from the command-line in MySQL Server.

mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| ╨╖╨░╨║╨░╨╖╤Л         |
| ╨║╨╗╨╕╨╡╨╜╤В╤Л        |
+----------------+
2 rows in set (0.00 sec)

My first guess was that their names encoded with wrong charsets. I've found the next command to see character sets that i'm using

mysql> show variables like 'char%';

the output was:

+--------------------------+----------------------------------------------------+
| Variable_name            | Value
       |
+--------------------------+----------------------------------------------------+
| character_set_client     | utf8
       |
| character_set_connection | utf8
       |
| character_set_database   | utf8
       |
| character_set_filesystem | binary
       |
| character_set_results    | utf8
       |
| character_set_server     | utf8
       |
| character_set_system     | utf8
       |
| character_sets_dir       | C:\Program Files (x86)\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+-----------------------------------------------------+
8 rows in set (0.00 sec)

So seems like it's like ok here and the problem lies in other place. I've found the similar problem charsets in MySQL replication and so my conclusion is that there's a problem with my config. So how I should modify config to change the result ?

SOLVED

So the problem was really with console encoding which wrongly interpret table names. I solved it by renaming the table names into latin alphabet. As RandomSeed mentioned another way is changing the console encoding.

Community
  • 1
  • 1
marknorkin
  • 3,904
  • 10
  • 46
  • 82

1 Answers1

2

Assuming you are on a Windows console (assumed from character_sets_dir), the console uses the CP-850 encoding (or I am told this may differ depending on your region), and therefore does not interpret correctly the UTF-8 stream sent by the MySQL client.

You can SET NAMES cp850 to match MySQL with your actual console encoding, if 1. the charset is available on your installation and 2. the table names' characters are supported by CP-850.

Alternatively, change your console encoding (solution not tested)

Community
  • 1
  • 1
RandomSeed
  • 29,301
  • 6
  • 52
  • 87