作者htorihpes (猪排)
看板Programming
标题Re: utf8的mysql档案为何不能用指令的方式汇入
时间Sun Mar 11 19:13:47 2007
※ 引述《buganini (霸格尼尼)》之铭言:
: ※ 引述《[email protected] (我要出清)》之铭言:
: : 请教一下,若我的资料表格式是utf8
: : 为何当我汇入时,若在phpmyAdmin内可以汇入
: : 但是若在windows内下指令,却会出现以下的讯息呢?
: : C:\>mysql -uxyy -pxxx twxx <command.sql
: : ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check
: : the ma
: : nual that corresponds to your MySQL server version for the right syntax to
: : use n
: : ear '嚜澳ROP TABLE IF EXISTS `configuration_test`' at line 1
: : 这个资料表我放在以下的位置
: : http://rapidshare.com/files/20454193/command.zip
: : 若各位有兴趣,可否下载下来试试看?
: : 谢谢!
: 应该是档头的BOM作怪
: 用NotePad++,ConvertZ,UltraEdit
: 之类的程式把BOM弄掉应该就好了
也有可能是mysql monitor将汇入档案的character set判断错误所致
我的作法通常是:
先登入mysql monitor
mysql > set names 'utf8';
mysql > use yourdbname
mysql > source yoursqlfile.sql
参考看看^^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.165.184.135
1F:推 LPH66:由指令的怪字应可判断为BOM问题192.192.197.115 03/11 22:34