Re: utf8的mysql檔案為何不能用指令的方式匯入
※ 引述《buganini (霸格尼尼)》之銘言:
: ※ 引述《quota@kkcity.com.tw (我要出清)》之銘言:
: : 請教一下,若我的資料表格式是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
推
03/11 22:34, , 1F
03/11 22:34, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
Programming 近期熱門文章
PTT數位生活區 即時熱門文章