How do I insert a special character such as ' into MySQL?

前端 未结 5 1751
南旧
南旧 2020-12-19 01:50

I am executing the insert query from a shell script which reads data from multiple files. Some of the data to be inserted contains \' in the text a

5条回答
  •  醉话见心
    2020-12-19 02:18

    You need to escape your quote. You can do this by doubling it in your insert query; i.e. use '' rather than '. That is two single quotes rather than a single double quote.

提交回复
热议问题