Specifying the escape character inserted by mysqldump in sql files

I would like to be able to control and specify the escape character used by mysqldump to export data.

Instead of \ I would like to use double backslash \\ or ''

Besides --fields-escaped-by=char , which seems to be used for tab delimited exports, I have not been able to find a suitable option.

Can anybody help?

+4
source share
1 answer

I ran into this problem. There is an error to open an error in this in MySQL error debugger (which is surprising because it is such a basic thing). My quick solution was connecting mysqldump via sed:

 [your mysqldump command] | sed "s/\\\'/''/g" > dumpfile.sql 
+3
source

Source: https://habr.com/ru/post/1399258/


All Articles