Phpmyadmin Export/Import issue with line breaks

2020-03-25 15:24发布

问题:

I try to export a wordpress database from my old host via phpmyadmin.
I leave all settings on default and in the sql file, all new lines are seperated by "\n" command (or "\n" or "\n\n")

Then i import this sql file into my new server via phpmyadmin, but now in phpmyadmin the line breaks are not invisible, but u can see alot of "\n" and "\n\n"

In the old phpmyadmin i couldnt see those "\n", instead there were real line breaks.
And when looking at the page via browser, its even worse. Theres not only "\n" but also "\r\n"

Any ideas please, what could be the problem?! (both are utf8)

edit:

i am sure it is more an export then an import problem, because another database i imported earlier from another host, worked fine and those "\n"'s work, but i have no idea why this 1 backup is broken

回答1:

Which phpMyAdmin version are you using on each system? There is a bug with version 4.6.5.1 that causes this issue on export. phpMyAdmin 4.6.5.2 has been released to address this, or you can use this patch if you desire.

Edited to include the news that 4.6.5.2 has been released



回答2:

As Issac said, it seems to be a bug with phpmyAdmin version 4.6.5.1 who generates this problem. In my case, I have searched thru all the .sql file for this 3 strings:

\\r\\n
\\n
\\r

And replaced them with a space. Everything works perfectly again.