最佳答案
英文原文
In Workbench, open a MySQL connection and then navigate to [Server] --> [Data Export]. There are several backup options here, including saving the data as an individual file or folder. Choose the databases you want to export, and then click [Start Export].
If you ever prefer using Excel for editing and such, then use the MySQL for Excel plugin to access MySQL databases from within Excel. However, I don't think you need it here.
中文翻译
在Workbench中,打开MySQL连接,然后导航到[Server] - > [数据导出]。这里有几个备份选项,包括将数据保存为单个文件或文件夹。选择要导出的数据库,然后单击[开始导出]。
如果您更喜欢使用Excel进行编辑等,请使用MySQL for Excel从Excel中访问MySQL数据库的插件。但是,我认为你不需要它。
In Workbench, open a MySQL connection and then navigate to [Server] --> [Data Export]. There are several backup options here, including saving the data as an individual file or folder. Choose the databases you want to export, and then click [Start Export].
If you ever prefer using Excel for editing and such, then use the MySQL for Excel plugin to access MySQL databases from within Excel. However, I don't think you need it here.
在Workbench中,打开MySQL连接,然后导航到[Server] - > [数据导出]。这里有几个备份选项,包括将数据保存为单个文件或文件夹。选择要导出的数据库,然后单击[开始导出]。
如果您更喜欢使用Excel进行编辑等,请使用MySQL for Excel从Excel中访问MySQL数据库的插件。但是,我认为你不需要它。
参考答案2
To export your mySQL data, use mysqldump, which will create all the schema for you.
Excel probably added some stuff to your file and now mySQL can't understand it. The best way to find out is by comparing the files before and after the change.
参考答案3
That error indicates a format problem. If the file is small enough, try opening it in wordpad (or the mac equivalent) and see if there's any difference in the formatting? Could be that the delimiting got a little messed up (this can happen especially with end of row markers in MySQL, I've noticed, it can also happen in mac to pc handoffs). If all else fails you could try exporting using a different format and see if that makes a difference (maybe tsv) when you add new rows.
参考答案4
Another reason can be the line endings used. Depending on the system and editor used to work with the cvs file it the line endings might get changed. For me mysql supported UNIX line endings. And in the editor the line ending had been set to MAC OS 9 since I was using a MAC.
Changing it to UNIX line ending worked.
参考答案5
I found that it might be due to a wrong encoding of the input file.
Using Notepad++ for example (or another similar editor) you need to change file encoding to UTF-8.