Bug #31292 | output from mysql --execute "select .." does not support unicode | ||
---|---|---|---|
Submitted: | 29 Sep 2007 14:40 | Modified: | 8 Oct 2007 5:52 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S2 (Serious) |
Version: | 5.0.45 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[29 Sep 2007 14:40]
Peter Laursen
[29 Sep 2007 14:42]
Peter Laursen
small dump with identifiers and data that requires unicode
Attachment: uni.sql (application/octet-stream, text), 1.15 KiB.
[29 Sep 2007 14:44]
Peter Laursen
changing OS from 'any' ot Windows!
[29 Sep 2007 17:08]
Valeriy Kravchuk
Thank you for a problem report. What exact version of MySQL server you had used?
[29 Sep 2007 18:31]
Peter Laursen
sorry .. forgot that. And it was a good point actually! I forgot I was connected to a remote Linux server. The file was created on the server in var/lib/mysql folder! This is not reproducable when connected to 5.1.18, 5.0.45 and 4.1.22 on 'localhost' (Windows). File created is UTF8-encoded with the data of this example. So 'not a bug' ...
[30 Sep 2007 21:41]
Peter Laursen
same test case! C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root -p --execute "select * from test.qwerty" > c:\tst.sql Enter password: ******** C:\Program Files\MySQL\MySQL Server 5.0\bin>
[30 Sep 2007 21:42]
Peter Laursen
file is ANSI encoded!
Attachment: tst.sql (application/octet-stream, text), 118 bytes.
[8 Oct 2007 5:52]
Alexander Barkov
If you want utf8 output, you need to specify it in either command line: mysql --default-character-set=utf8 -u root -p --execute "select * from test.qwerty" > c:\tst.sql or if you prefer utf8 by default, you can put this option into your my.cnf file. This is not a bug. Everything works according to design.