How to find MySQL version

[root@db ~]# mysql -u root -p -e 'SHOW VARIABLES LIKE "%version%";'

Enter password:

+-------------------------+---------------------+

| Variable_name           | Value               |

+-------------------------+---------------------+

| innodb_version          | 5.5.49-MariaDB-37.9 |

| protocol_version        | 10                  |

| slave_type_conversions  |                     |

| version                 | 5.5.50-MariaDB      |

| version_comment         | MariaDB Server      |

| version_compile_machine | x86_64              |

| version_compile_os      | Linux               |

+-------------------------+---------------------+

 

Or

 

[root@db ~]# mysql -u root -p -e ' SELECT VERSION(); '

Enter password:

+----------------+

| VERSION()      |

+----------------+

| 5.5.50-MariaDB |

+----------------+

 

Or

[root@db ~]# mysql -u root -p -e 'STATUS'

Enter password:

--------------

mysql  Ver 15.1 Distrib 5.5.50-MariaDB, for Linux (x86_64) using readline 5.1

 

Connection id:          891164

Current database:

Current user:           root@localhost

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ''

Using delimiter:        ;

Server:                 MariaDB

Server version:         5.5.50-MariaDB MariaDB Server

Protocol version:       10

Connection:             Localhost via UNIX socket

Server characterset:    utf8

Db     characterset:    utf8

Client characterset:    utf8

Conn.  characterset:    utf8

UNIX socket:            /tmp/mysql.sock

Uptime:                 221 days 15 hours 52 min 26 sec

 

Threads: 101  Questions: 56945893852  Slow queries: 366  Opens: 3018  Flush tables: 2  Open tables: 123  Queries per second avg: 2973.435

 

Or

[root@db ~]# mysqladmin -u root -p version

Enter password:

mysqladmin  Ver 9.0 Distrib 5.5.50-MariaDB, for Linux on x86_64

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

 

Server version          5.5.50-MariaDB

Protocol version        10

Connection              Localhost via UNIX socket

UNIX socket             /tmp/mysql.sock

Uptime:                 221 days 15 hours 53 min 57 sec

 

Threads: 101  Questions: 56946100784  Slow queries: 366  Opens: 3018  Flush tables: 2  Open tables: 123  Queries per second avg: 2973.432

Comments