Bug #4960 Mysql cmdline client fails on byte order mark
Submitted: 9 Aug 2004 16:42 Modified: 19 May 2005 16:34
Reporter: Ulrich Bayer Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:4.1.3b OS:
Assigned to: Assigned Account CPU Architecture:Any

[9 Aug 2004 16:42] Ulrich Bayer
Description:
The command client mysql exits with an unuseful error message when fed with a text-file that starts with the byte sequence EF BB BF (= utf8 byte order mark).
This is pretty bad since windows notepad will automatically add these three bytes to the beginning of an utf8-sql-dump file when the file is saved.

http://www.unicode.org/unicode/faq/utf_bom.html#BOM

How to repeat:
C:\mysql-4.1\bin>mysql -uroot < "C:\test 20040809 1610.sql"
ERROR 1064 at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ยด&#9559;&#9488;SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT' at line 1
[19 May 2005 14:50] Robin Massart
Is there any intention of fixing this in an upcoming release. This is a pretty important bug, given that MySQL is supposed to support Unicode, but doesn't recognise the BOM.

Thanks,
Robin
[19 May 2005 16:34] Sergei Golubchik
see also http://bugs.mysql.com/bug.php?id=10573
[6 Nov 2008 10:40] Michael Pliskin
Any chance for this problem to be fixed? Still present for 5.0.