Each time you use the mysql console, a version is displayed.
$ mysql -u user
Successfully logging into the console shows the following, which includes the mysql server version.
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1432 Server version: 5.5.9-log Source distribution Copyright (c) 2000, 2010, 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. mysql>
You can also check the mysql server version directly by running the following command:
$ mysql --version
You can also check version information from the mysql console itself using version variables:
mysql> SHOW VARIABLES LIKE "%version%";
The result will be something like this:
+-------------------------+---------------------+ | Variable_name | Value | +-------------------------+---------------------+ | innodb_version | 1.1.5 | | protocol_version | 10 | | slave_type_conversions | | | version | 5.5.9-log | | version_comment | Source distribution | | version_compile_machine | i386 | | version_compile_os | osx10.4 | +-------------------------+---------------------+ 7 rows in set (0.01 sec)
The STATUS command also displays version information.
mysql> STATUS
You can also check the version by running the following command:
mysql -v
If you come across something like this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
You can fix this:
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
wens
source share