Can I tell what version (32 bit or 64 bit) of MySQL I am running by using Terminal?
问题:
回答1:
$ 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
--------------
回答2:
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.
回答3:
You can use version()
:
SELECT version();
See more information here :)
回答4:
Running the command-line MySQL client:
mysql> select version();
OR
mysql> \s
which is an alias for:
mysql> status
回答5:
You could try the command: (no login needed)
mysql -V
回答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.
回答7:
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
回答8:
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.
回答9:
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
--------------
回答10:
No login is needed (OS X 10.11).
$ /usr/local/mysql/bin/mysqld --version