How to store varbinary in MySQL?

前端 未结 1 1844
梦毁少年i
梦毁少年i 2021-01-12 06:59

Just a quick question..

Out of two options mentioned below, how to store to varbinary column in MySQL?

public_key = \'674989305896357646         


        
1条回答
  •  执念已碎
    2021-01-12 07:41

    Printable data can be inserted using quotes. Non-printable data can be inserted using hexadecimal values. I.e.:

    INSERT INTO Table(VarBinaryColumn) VALUES('Printable data') -- Will be stored as binary representation using the charset of the operating system
    
    INSERT INTO Table(VarBinaryColumn) VALUES(0x12345) -- Non-printable binary data
    

    0 讨论(0)
提交回复
热议问题