1
我有MySQL 5.5.24。 Сallinguuid_short()几次,我得到只是一个递增值:MySQL:如何生成uuid_short?
mysql> select uuid_short();
+-------------------+
| uuid_short() |
+-------------------+
| 22851044396498953 |
+-------------------+
1 row in set (0.00 sec)
mysql> select uuid_short();
+-------------------+
| uuid_short() |
+-------------------+
| 22851044396498954 |
+-------------------+
1 row in set (0.00 sec)
但manual说:
The UUID_SHORT() return value is constructed this way:
(server_id & 255) << 56
+ (server_startup_time_in_seconds << 24)
+ incremented_variable++;
好像既不是 “server_startup_time_in_seconds” 或 “SERVER_ID” 的转变。 (我改变了@@global.server_id
系统变量,并没有任何效果)。
有谁知道为什么?
'server_startup_time_in_seconds'不应该改变,直到你重新启动mysql。另外,您是如何更改'global.server_id'变量的? – vadipp 2013-02-28 11:31:27
@vadipp,'set @@ global.server_id = N;' – Olga 2013-02-28 11:34:37