Check mySQL version on Mac 10.8.5

How can I check (step by step) the version of mySQL installed on my Mac 10.8.5?

I tried using the command line but could not understand.

+7
mysql version osx-snow-leopard macos
source share
3 answers

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 
+16
source share

To check the version of MySQL on your Mac, go to the directory in which you installed it (by default it is usr / local / mysql / bin) and displays:

 ./mysql --version 

Alternatively, to avoid having to go to this director to run the command, add its location to your path. There is more than one way to add a directory to PATH (with explanations in stackoverflow and other places on how to do this), for example, add it to yours. / bash _profile.

After adding the mysql bin to your $ PATH, check it there by doing:

 echo $PATH 

After that, you can check the mysql version from anywhere by running (note no) ./ "):

 mysql --version 
+5
source share

You should be able to open a terminal and just type

mysql -v

-4
source share

All Articles