How to get MySQL Version

Using this tutorial, we can find the MySQL Version with different methods. We can find MySQL Server using MySQL command or Linux based commands. Following are easy methods

1. By running following MySQL command.

SELECT version();
or
SELECT VERSION();
or
select @@version;

Output:

mysql> select version(); +-------------------------+ | version() | +-------------------------+ | 5.7.20-0ubuntu0.16.04.1 | +-------------------------+

mysql> select VERSION(); +-------------------------+ | VERSION() | +-------------------------+ | 5.7.20-0ubuntu0.16.04.1 | +-------------------------+

mysql> select @@version; +-------------------------+ | @@version | +-------------------------+ | 5.7.20-0ubuntu0.16.04.1 | +-------------------------+ 1 row in set (0.04 sec)

2. By running following MySQL command: SHOW VARIABLES LIKE “%version%”;

Output

mysql> SHOW VARIABLES LIKE "%version%"; +-------------------------+-------------------------+ | Variable_name | Value | +-------------------------+-------------------------+ | innodb_version | 5.7.20 | | protocol_version | 10 | | slave_type_conversions | | | tls_version | TLSv1,TLSv1.1 | | version | 5.7.20-0ubuntu0.16.04.1 | | version_comment | (Ubuntu) | | version_compile_machine | x86_64 | | version_compile_os | Linux | +-------------------------+-------------------------+ 8 rows in set (0.01 sec)

3. We can also the version once we login into mysql

a)Open the Linux terminal and login to mysql.

prvr@ubuntu:~$ mysql -u root -p
Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 23 Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

3. BY running linux(unix) level command mysql -V or mysql -Version

prvr@ubuntu:~$ mysql -V mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper prvr@ubuntu:~$ mysql -Version mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper

3. BY running linux(unix) level command mysql -uroot -p -hlocalhost mysql -e ‘select version()’;

prvr@ubuntu:~$ mysql -uroot -p -hlocalhost mysql -e ‘select version()’;
Enter password:

Ouput:

+-------------------------+ | version() | +-------------------------+ | 5.7.20-0ubuntu0.16.04.1 | +-------------------------+

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: