30

Can I tell what version (32 bit or 64 bit) of MySQL I am running by using Terminal?

4
  • 1
    My apologies, I was actually looking for whether I am running a 32 bit or 64 bit version and found this on search: capttofu.livejournal.com/14645.html which seems to be for linux not mac Aug 12, 2011 at 19:38
  • It's not "for linux" or "for mac". You have the same mysql software installed. You can type the same commands. Aug 12, 2011 at 19:39
  • The file references on the link don't match what exists on a mac i.e. file /usr/local/mysql/libexec/mysqld/ givesme an error Aug 12, 2011 at 19:44
  • They don't match the path on another Linux user's computer either. Everyone can install software to whatever directory they want on every operating system. You have to use the path you installed mysql to. Aug 12, 2011 at 19:46

10 Answers 10

43
$ mysql --version
mysql  Ver 14.14 Distrib 5.1.45, for apple-darwin10.2.0 (i386) using readline 6.2


$ echo '\s' | mysql
--------------
mysql  Ver 14.14 Distrib 5.1.45, for apple-darwin10.2.0 (i386) using readline 6.2

Connection id:      105730
[...]
Server version:     5.1.41 MySQL Community Server (GPL)
[...]
Uptime:         11 days 4 hours 2 min 6 sec

Threads: 2  Questions: 1141270  Slow queries: 0  Opens: 6137  Flush tables: 1  Open tables: 56  Queries per second avg: 1.182
--------------
27

run this command in command line:

mysql> show variables like 'version_compile_machine';

then you get something like this:

+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| version_compile_machine | i386  |
+-------------------------+-------+
1 row in set (0.00 sec)

and then please check this: http://www.redhat.com/archives/rhl-list/2006-October/msg03684.html

you'll see that i386/i686 are 32 bit, and x86_64 is 64 bit.

Hope this helps.

14

You can use version():

SELECT version();

See more information here :)

1
  • Simplest answer! Works just by running this command on a query. :) Feb 29, 2016 at 13:02
8

Running the command-line MySQL client:

mysql> select version();

OR

mysql> \s

which is an alias for:

mysql> status
7

You could try the command: (no login needed)

mysql -V
1
  • NOTE: The parameter has to be an uppercase "V". Lowercase "v", needs authentication.
    – ttt
    Jun 28, 2017 at 11:35
6

To know your Mysql bit architecture please follow this step. Open Mysql console from phpmyadmin

Now after entering password type this command

show global variables like 'version_compile_machine';

if version_compile_machine = x86_64 then it is 64 bit

else 32 bit.

0
2

I was searching for this also (core dump issues connecting to mysql) and it seemed none of the above answers properly answered the question: e.g. mysql version info doesn't include the build type 32or 64 bit.

found this capttofu: Do I have a 32-bit or 64-bit MySQL? captoflu which uses a simple "file" command to tell what build youre running, in my case.

BensAir:~ Ben$ /usr/local/mysql/bin/mysqld --verbose --help
file /usr/local/mysql/bin/mysqld
/usr/local/mysql/bin/mysqld: Mach-O 64-bit executable x86_64
2

Get mysql version In Windows with --version parameter:

C:\>C:\xampp\mysql\bin\mysql.exe --V

C:\xampp\mysql\bin\mysql.exe  Ver 14.14 Distrib 5.6.11, for Win32 (x86)

Get mysql version In Windows with custom query:

C:\>C:\xampp\mysql\bin\mysql.exe

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.11    |
+-----------+
1 row in set (0.00 sec)

mysql>

Get mysql version in Windows with server variable:

mysql> select @@Version;
+-----------+
| @@Version |
+-----------+
| 5.6.11    |
+-----------+
1 row in set (0.00 sec)

mysql>

Get mysql version in Windows with \s flag.

mysql> \s

--------------
C:\xampp\mysql\bin\mysql.exe  Ver 14.14 Distrib 5.6.11, for Win32 (x86)

Connection id:          25
Current database:
Current user:           ODBC@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.6.11 MySQL Community Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    cp850
Conn.  characterset:    cp850
TCP port:               3306
Uptime:                 2 hours 48 min 52 sec

Threads: 1  Questions: 169  Slow queries: 0  Opens: 75  Flush tables: 1  Open 
tables: 68  Queries per second avg: 0.016
--------------
1

Use @@version server variable.

select @@version;

This is what I get on my server:

mysql> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 5.0.67-0ubuntu6 |
+-----------------+
1 row in set (0.00 sec)

Hope it helps.

Here's a list of all server variables.

1

No login is needed (OS X 10.11).

$ /usr/local/mysql/bin/mysqld --version
1
  • 1
    Lets hope they haven't been waiting 5 years for an answer! May 19, 2016 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.