Ubuntu 22.04 LTSにMySQLのバージョンを確認する方法

環境
OSバージョンの確認

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"

1.MySQLに接続前バージョンを確認します
# mysql –version
mysql Ver 8.0.29-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

2.MySQLに接続後MySQLのバージョンを確認します
方法1

mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 8.0.29-0ubuntu0.22.04.1 |
+-------------------------+
1 row in set (0.00 sec)

方法2

mysql> status
--------------
mysql  Ver 8.0.29-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Connection id:          11
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         8.0.29-0ubuntu0.22.04.1 (Ubuntu)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:            /var/run/mysqld/mysqld.sock
Binary data as:         Hexadecimal
Uptime:                 32 min 40 sec

Threads: 2  Questions: 34  Slow queries: 0  Opens: 158  Flush tables: 3  Open tables: 77  Queries per second avg: 0.017
--------------

 

Ubuntu 22.04

Posted by arkgame