This is a discussion on mysqldump question within the MySQL Database forums, part of the Database Forums category; I am trying to get rid of the \ escape characters. I am on version 4.0.21. When I try ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am trying to get rid of the \ escape characters. I am on version 4.0.21.
When I try to export the data using mysqldump, the utility adds a \ before the < characters. I tried using --fields-escaped-by="" but got the error -- option '--fields-escaped-by' cannot take an argument. How can I get rid of the \ before <ABC>, <a href> etc.? cat test.sh DATABASE="rktemp" USERNAME="root" DESTINATION_PATH="/home/rkapur/rktemp" mysqldump -u ${USERNAME} -p -T ${DESTINATION_PATH} --fields-terminated-by='<ec>' --lines-terminated-by='<er>' ${DATABASE} testrk lalo:/home/rkapur/rktemp > ../test.sh ;cat testrk.txt Enter password: 1<ec>ABC<ec>\<ABC><er>2<ec>DEF<ec>\<a href> ABC \</a><er>3<ec>?<ec>"'"<er>4<ec>#<ec>c:\\aproj\\main<e r>lalo:/home/rkapur/rktemp > lalo:/home/rkapur/rktemp > =========================== Here is the raw data .... mysql> use rktemp Database changed mysql> select * from testrk; +-------+-----------+-------------------+ | rk_id | rk_char_1 | rk_text_1 | +-------+-----------+-------------------+ | 1 | ABC | <ABC> | | 2 | DEF | <a href> ABC </a> | | 3 | ? | "'" | | 4 | # | c:\aproj\main | +-------+-----------+-------------------+ 4 rows in set (0.01 sec) mysql> |