DIFFERENT WAYS TO CHECK MYSQL VERSION

There are multiple ways to check the current version of mysql distribition

Use ‘status’ command to check the server version

mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.                                      1

Connection id:          15
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.1.73 Source distribution
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:                 1 hour 23 min 25 sec

Threads: 1  Questions: 864  Slow queries: 0  Opens: 30  Flush tables: 1  Open ta                                      bles: 23  Queries per second avg: 0.172
--------------

Use select command

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.1.73    |
+-----------+
1 row in set (0.00 sec)

Filter from show variables

mysql> show variables like '%version%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  |
| version                 | 5.1.73              |
| version_comment         | Source distribution |
| version_compile_machine | x86_64              |
| version_compile_os      | redhat-linux-gnu    |
+-------------------------+---------------------+
5 rows in set (0.00 sec)

Use mysql utility with –version or -V option

[root@tibero tibero]# mysql --version
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

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

[root@tibero tibero]# mysql -V
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.                                      1

Use –help option and grep the version

[root@tibero tibero]# mysql --help|grep 'Distr'
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

If you want to directly invoke commands from database,try this

[root@tibero tibero]# mysql -u root -p -e 'status'|grep 'Server version'
Enter password:
Server version:         5.1.73 Source distribution

We can also use mysqld to check the version

[root@tibero tibero]# /usr/libexec/mysqld --help|grep 'dist'
/usr/libexec/mysqld  Ver 5.1.73 for redhat-linux-gnu on x86_64 (Source distribution)

-------------------------------------------------------------------------------------------
[root@tibero tibero]# /usr/libexec/mysqld --version
/usr/libexec/mysqld  Ver 5.1.73 for redhat-linux-gnu on x86_64 (Source distribution)

These are multiple ways of checking version of mysql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s