How to handle null field when exporting MYSQL tables to CSV

前端 未结 4 1070
死守一世寂寞
死守一世寂寞 2021-02-18 21:36

Right now when I export MYSQL tables to CSV files, I\'m getting \\N for NULL fields in the database which is expected. If there a way to change the \\N output to just an empty s

4条回答
  •  旧巷少年郎
    2021-02-18 22:08

    From MySQL documentation

    If the FIELDS ESCAPED BY character is empty, no characters are escaped and NULL is output as NULL, not \N. It is probably not a good idea to specify an empty escape character, particularly if field values in your data contain any of the characters in the list just given.

提交回复
热议问题