MySQL 9.3 Reference Manual Including MySQL NDB Cluster 9.3

30.4.5.20 The version_major() Function

This function returns the major version of the MySQL server.

Parameters

None.

Return Value

A TINYINT UNSIGNED value.

Example
mysql> SELECT VERSION(), sys.version_major();
+-----------+---------------------+
| VERSION() | sys.version_major() |
+-----------+---------------------+
| 9.3.0     |                   9 |
+-----------+---------------------+