I mean this document. I need server_id for the short mysql uuid function.
https://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_server_id
How can I print server_id via mysql console? Thanks
You can do it with
SELECT @@server_id
as @@ points to globally defined variables (not like one @ , which is for session-defined variables)
@@
@
For example,
SELECT CONCAT(@@server_id, UUID());
mysql> SHOW VARIABLES LIKE 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 1 | +---------------+-------+ 1 row in set (0.01 sec)