iT邦幫忙

0

使用BigDump匯入資料庫時出錯

  • 分享至 

  • twitterImage

https://ithelp.ithome.com.tw/upload/images/20180714/201030613g8Cf27TNU.png

出現
Error at the line 41: ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
google查了一下有人改成ENGINE=MyISAM DEFAULT CHARSET=latin1;" with ");"
就可以正常 但是我不知道這個要在哪裡改 我對資料庫語句不是很熟悉 有大大能教嗎?

我的mysql 版本5.7.21

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
暐翰
iT邦大師 1 級 ‧ 2018-07-14 16:40:22
最佳解答
  1. 看起來是你重複建立表格
    請看圖片

    wp_ahm_download_stats表格已經存在了

2.ENGINE=MyISAM DEFAULT CHARSET=latin1;
你的問題不是在這裡,所以簡單描述就可以
前面代表要使用哪種引擎:
MySQL有CSV、Innodb...每個都有各自的獨特處理的功能
後面代表使用哪種字符集
就像windows簡體、繁體語言包差別
建議使用utf-8

看更多先前的回應...收起先前的回應...
d2598798 iT邦新手 5 級 ‧ 2018-07-14 16:42:41 檢舉

要怎麼改utf8

暐翰 iT邦大師 1 級 ‧ 2018-07-14 16:44:54 檢舉

舉例:

CREATE TABLE Table0 (`name` varchar(32), `age` int, `city` varchar(6))   
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci 
d2598798 iT邦新手 5 級 ‧ 2018-07-14 16:45:27 檢舉

ok 我刪除了 舊的資料表
現在出現
Stopped at the line 345.

At this place the current query includes more than 300 dump lines. That can happen if your dump file was created by some tool which doesn't place a semicolon followed by a linebreak at the end of each query, or if your dump contains extended inserts or very long procedure definitions. Please read the BigDump usage notes for more infos. Ask for our support services in order to handle dump files containing extended inserts.

暐翰 iT邦大師 1 級 ‧ 2018-07-14 16:51:21 檢舉

找到bigdump.php檔案
用文本編輯器把define ('MAX_QUERY_LINES',300);
中300的數字改大

方法來源:
mysqldump - MySQL Import Database Error because of Extended Inserts - Stack Overflow

d2598798 iT邦新手 5 級 ‧ 2018-07-14 17:42:18 檢舉

所以原本是

DEFAULT CHARSET=latin1

改成

DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci 

也可以嗎? 不用=?

暐翰 iT邦大師 1 級 ‧ 2018-07-14 17:59:31 檢舉

可以

舉例:

CREATE TABLE test (
 id INT DEFAULT NULL
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE TABLE test2 (
 id INT DEFAULT NULL
) DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_unicode_ci;

線上測試鏈結


其他補充可以看S.O這篇
What is the best collation to use for MySQL with PHP? - Stack Overflow

我要發表回答

立即登入回答