Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 command prompt, but couldn't figure out.

like image 848
user2626498 Avatar asked Oct 19 '13 04:10

user2626498


People also ask

How do I check MySQL version on Mac?

In MySQL Command Line Client, enter the following command: SHOW VARIABLES LIKE 'version'; The MySQL version will be shown instantly.

What is MySQL version Mac?

To check your MySQL version on your mac, navigate to the directory where you installed it (default is usr/local/mysql/bin) and issue this command: ./ mysql --version.


2 Answers

Every time you used the mysql console, the version is shown.

 mysql -u user 

Successful console login 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 executing the following command:

mysql --version 

You may also check the version information from the mysql console itself using the version variables:

mysql> SHOW VARIABLES LIKE "%version%"; 

Output 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) 

You may also use this:

mysql> select @@version; 

The STATUS command display version information as well.

mysql> STATUS 

You can also check the version by executing this command:

mysql -v 

It's worth mentioning that if you have encountered something like this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 

you can fix it by:

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock 
like image 97
vvens Avatar answered Sep 25 '22 03:09

vvens


To check your MySQL version on your mac, navigate to the directory where you installed it (default is usr/local/mysql/bin) and issue this command:

./mysql --version 

Alternatively, to avoid needing to navigate to that specific dir to run the command, add its location to your path ($PATH). There's more than one way to add a dir to your $PATH (with explanations on stackoverflow and other places on how to do so), such as adding it to your ./bash_profile.

After adding the mysql bin dir to your $PATH, verify it's there by executing:

echo $PATH 

Thereafter you can check your mysql version from anywhere by running (note no "./"):

mysql --version 
like image 41
Woodchuck Avatar answered Sep 24 '22 03:09

Woodchuck