get mysql version from query code example
Example 1: mysql version
# console
mysql --version
mysql -V
# sql query
SHOW VARIABLES LIKE ‘%version%’;
Example 2: how to get current mysql version
SELECT VERSION ();
# console
mysql --version
mysql -V
# sql query
SHOW VARIABLES LIKE ‘%version%’;
SELECT VERSION ();