Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

UUID of MySQL

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MySQL generates a UUID when initializing:

[root@mha03 opt] # mysql/bin/mysqld-initialize-user=mysql-basedir=/opt/mysql/-datadir=/opt/mysql/data/

2019-08-14T03:42:26.588685Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2019-08-14T03:42:26.899821Z 0 [Warning] InnoDB: New log files created, LSN=45790

2019-08-14T03:42:26.944820Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2019-08-14T03:42:27.023508Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 88e4e8ea-be45-11e9-b3d0-000c29c8d0f8.

2019-08-14T03:42:27.024729Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2019-08-14T03:42:27.026127Z 1 [Note] A temporary password is generated for root@localhost: & didSDjQn2dk

UUID is an abbreviation for Universal unique Identification number (Universally Unique Identifier), a standard for software construction, and a part of the Open Software Foundation in the field of distributed computing environments. Its purpose is to make all the elements in the distributed system have unique identification information without the need to specify the identification information through the central control terminal. In this way, everyone can create a UUID that does not conflict with others. In this case, there is no need to consider the problem of duplicate names when the database is created. At present, the most widely used UUID is Microsoft's Global unique Identifier (GUID), while other important applications are Linux ext2/ext3 file system, LUKS encrypted partition, GNOME, KDE, Mac OS X and so on. We can also find the implementation in the UUID library in the e2fsprogs package.

Define

UUID consists of a set of 32-digit hexadecimal digits, so the theoretical total of UUID is 16 ^ 32 = 2 ^ 128, which is about 3.4 x 10 ^ 38. In other words, if you generate 1 trillion UUID per nanosecond, it will take 10 billion years to use up all the UUID.

The standard form of UUID consists of 32 hexadecimal digits, divided into five segments by hyphens, and 32 characters in the form of 8-4-4-4-12. Example:

550e8400-e29b-41d4-a716-446655440000

UUID can also be deliberately repeated to indicate the same kind. For example, in Microsoft's COM, all components must implement the IUnknown interface by generating a UUID that represents IUnknown. Whether the program attempts to access the IUnknown interface in the component, or the component that implements the IUnknown interface, as long as the IUnknown is used, it will be referred to the same ID:00000000-00000046-0000-C000-00000046. [1]

Composition

UUID is a number generated on a machine that is guaranteed to be unique to all machines in the same space-time. Typically, the platform provides the generated API. According to the standard calculation established by the Open Software Foundation (OSF), the Ethernet card address, nanosecond time, chip ID code and random number are used.

UUID consists of a combination of the following parts:

(1) current date and time, the first part of UUID is related to time. If you generate a UUID and then generate a UUID in a few seconds, the first part is different and the rest are the same.

(2) clock sequence.

(3) the globally unique IEEE machine identification number, if there is a network card, it is obtained from the MAC address of the network card, and no network card is obtained by other means.

The only drawback of UUID is that the resulting string is relatively long. The most commonly used standard about UUID is Microsoft's GUID (Globals Unique Identifiers). In ColdFusion, you can simply generate UUID with the CreateUUID () function in the format: xxxxxxxx-xxxx- xxxx-xxxxxxxxxxxxxxxx (8-4-4-16), where each x is a hexadecimal number in the range of 0-9 or Amurf. The standard UUID format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12), which can be converted by downloading CreateGUID () UDF from cflib. [2]

(4) in hibernate (Java orm framework), the UUID is composed of IP-JVM startup time-current time 32 bits to the right-current time-internal count (8-8-4-8-4).

UUID function:

The purpose of UUID is to enable all elements in a distributed system to have unique identification information without the need to specify identification information through a central control terminal. In this way, everyone can build a UUID that does not conflict with others. In this case, there is no need to consider the problem of name duplication when the database is established. At present, the most widely used UUID is Microsoft's Microsoft's Globally Unique Identifiers (GUIDs), while other important applications are Linux ext2/ext3 file system, LUKS encryption partition, GNOME, KDE, Mac OS X and so on.

Zhengzhou Infertility Hospital: http://jbk.39.net/yiyuanzaixian/zztjyy/

UUID applications:

The benefits of using UUID can be reflected in distributed software systems (such as DCE/RPC, COM+,CORBA), it can ensure that the identity generated by each node will not be repeated, and with the development of integration technologies such as WEB services, the advantages of UUID will be more obvious. Depending on the specific mechanism used, UUID not only needs to be guaranteed to be different from each other, or at least very different from any other universally unique identifiers generated before AD 3400. UUID will not be repeated for at least 3000 + years.

Universal unique identifiers can also be used to point to most possible objects. Microsoft and other software companies tend to use globally unique identifiers (GUID), a type of universal unique identifiers that can be used to point to component object module objects and other software components. The first universal unique identifier was created in a network computer system (NCS) and subsequently became a component of the Open Software Foundation (OSF) distributed computing environment (DCE).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report