mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.15 |
+-----------+
1 row in set (0.00 sec)
方法二:
mysql> status
--------------
mysql Ver 8.0.15 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
Connection id: 613
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.15 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /tmp/mysql.sock
Uptime: 5 days 8 hours 37 min 21 sec
Threads: 37 Questions: 6324 Slow queries: 15 Opens: 757 Flush tables: 3 Open tables: 411 Queries per second avg: 0.013
--------------
方法三:
mysql> \s
--------------
mysql Ver 8.0.15 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
Connection id: 613
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.15 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /tmp/mysql.sock
Uptime: 5 days 8 hours 37 min 45 sec
Threads: 37 Questions: 6327 Slow queries: 15 Opens: 757 Flush tables: 3 Open tables: 411 Queries per second avg: 0.013
--------------
方法四:
mysql> show variables like "%version%";
+--------------------------------------------------+------------------------------+
| Variable_name | Value |
+--------------------------------------------------+------------------------------+
| group_replication_allow_local_lower_version_join | OFF |
| immediate_server_version | 999999 |
| innodb_version | 8.0.15 |
| original_server_version | 999999 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1,TLSv1.2 |
| version | 8.0.15 |
| version_comment | MySQL Community Server - GPL |
| version_compile_machine | x86_64 |
| version_compile_os | linux-glibc2.12 |
| version_compile_zlib | 1.2.11 |
+--------------------------------------------------+------------------------------+
12 rows in set (0.00 sec)
方法五:
$ mysql -V
mysql Ver 8.0.15 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)