I have a table 'ABC' (charset = utf8) and these are my character set variable values
[mysql version 4.1.23 - Server] and Client version - 3.23.57
mysql> show variables like 'character%';
+--------------------------+------------------------------------+ | Variable_name | Value | +--------------------------+------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /home/y/share/mysql/charsets/ | +--------------------------+------------------------------------+ 7 rows in set (0.00 sec)
Now if I run a query in mysql client
mysql>select * into outfile '/tmp/a' from ABC; Query OK, 26 rows affected (0.00 sec)
and check the filetype of /tmp/a
[satyavrk-~]$: file /tmp/a /tmp/a:UTF-8 Unicode text
Q1)Since my character_set_results is latin1 , how is the filetype of /tmp/a is UTF-8 instead of latin1 or ISO-8859 English text?
Alternatively if I run
[satyavrk-~]$: mysqldump -uroot --databases my --tables ABC --default-character-set=utf8 > 63794
and do
[satyavrk-~]$: file 63794 63794: ISO-8859 English text, with very long lines
Q2)Since I specified --default-character-set as UTF-8 the resultset should be utf8. But it is not! Why?
In both cases file type is different from expected
Can any one explain the point I am missing