1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MariaDB(サーバー)のバージョンを確認する方法

Last updated at Posted at 2023-04-17

環境

  • さくらVPSサーバー CentOS7
  • データベース MariaDB 5.5.68

インストールパッケージからバージョンを確認する方法

  • RedHat系の場合
    rpm -qa | grep -i mariadb
# rpm -qa | grep -i mariadb
mariadb-5.5.68-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64

→5.5.68とわかる。

※注:「mysql -V」で確認できるのは"mysqlクライアントの"バージョンなのでサーバーのバージョンではない。

MariaDB Serverに接続して確認する方法

1. サーバーでMariaDB(mysql)にログイン

mysql -u root -p
→パスワード入力
バージョンが表示される。

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1192
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

→5.5.68とわかる。

2. statusコマンドを使う

MariaDB [(none)]> status;
mysql  Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:          1194
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         5.5.68-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 24 days 38 min 34 sec

Threads: 1  Questions: 13912  Slow queries: 0  Opens: 157  Flush tables: 2  Open tables: 75  Queries per second avg: 0.006

3. select version()コマンドを使う

MariaDB [(none)]> select version();
+----------------+
| version()      |
+----------------+
| 5.5.68-MariaDB |
+----------------+
1 row in set (0.01 sec)

参考

MariaDB Serverのバージョンを確認する
MariaDB(MySQL)のバージョンを確認する【勘違いが多い】

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?