Inserting Binary data into MySQL (without PreparedStatement's)

前端 未结 3 1319
猫巷女王i
猫巷女王i 2021-01-12 16:05

I\'m trying to insert some Binary data into a MySQL database without using prepared statements. The reason for this is that I concatenate thousands of statements into a sing

3条回答
  •  不要未来只要你来
    2021-01-12 16:36

    Found the solution .... Although not something I saw documented anywhere .....

    You can insert Binary data directly by writing the bytes converted to HEX and preceeded by 0x

    For example:

    INSERT INTO my_table VALUES (1,0x19c0300dc90e7cedf64703ed8ae8683b,2);
    

提交回复
热议问题