1. 程式人生 > >【mysql】批量生產UUID

【mysql】批量生產UUID

問題描述:

批量插入資料,生產的UUID需要去掉中間的“-”。

注意問題:

當mysql字符集編碼為uftmp4,查詢replace(uuid(),"-","")一致

使用uft8mb4則不會一致

replace(convert(uuid() using utf8mb4), '-','')

bug:Function UUID() and REPLACE(), can't work together

參考官網:https://bugs.mysql.com/bug.php?id