Error importing MySQL data across platforms (MAMP to WIMP)

狂风中的少年 提交于 2019-12-02 09:51:38

The most likely cause for this problem is the different end of line conventions on DOS and UNIX platforms. Windows uses the DOS convention of '\r\n' for newlines, while Mac OSX and Linux use the UNIX convention of '\n' for newlines. To fix the problem, run the unix2dos utility on the mysql dump file on your Mac and then copy the file to your Windows box.

Are you sure you sure the mySQL linux server has permission to read the file?

  1. Your .sql file should be converted to unix file endings. You can use dos2unix (or frodos) on Mac & Linux.
  2. What is the size of your db.sql file? I think phpMyAdmin has file size limits.
  3. You could try using mysql at the command line to see if it gives you additional info.

mysql -u user -p -D db < file

@Zhehao pointed out the issue, which entails converting the newlines of the .sql file.

However, I just wanted to share another way around this that worked for me was to simply dump to the SQL pane instead of a file, and then copy-paste it into the target phpMyAdmin SQL pane.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!