简体   繁体   English

MySQL:检查什么版本:32位还是64位?

[英]MySQL: check what version : 32 bit or 64 bit?

Can I tell what version (32 bit or 64 bit) of MySQL I am running by using Terminal?我可以告诉我使用终端运行的 MySQL 的哪个版本(32 位或 64 位)?

$ 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
--------------

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然后请检查: 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.你会看到 i386/i686 是 32 位的,而 x86_64 是 64 位的。

Hope this helps.希望这可以帮助。

You can use version() :您可以使用version()

SELECT version();

See more information here:)在此处查看更多信息:)

Running the command-line MySQL client:运行命令行 MySQL 客户端:

mysql> select version();

OR或者

mysql> \s

which is an alias for:这是一个别名:

mysql> status

You could try the command: (no login needed)您可以尝试以下命令:(无需登录)

mysql -V

To know your Mysql bit architecture please follow this step.要了解您的 Mysql 位架构,请按照此步骤操作。 Open Mysql console from phpmyadmin从 phpmyadmin 打开 Mysql 控制台

Now after entering password type this command现在输入密码后输入此命令

show global variables like 'version_compile_machine';显示像'version_compile_machine'这样的全局变量;

if version_compile_machine = x86_64 then it is 64 bit如果 version_compile_machine = x86_64 那么它是 64 位

else 32 bit.否则 32 位。

Get mysql version In Windows with --version parameter:在 Windows 中使用 --version 参数获取 mysql 版本:

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:在 Windows 中通过自定义查询获取 mysql 版本:

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:使用服务器变量获取 Windows 中的 mysql 版本:

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

mysql>

Get mysql version in Windows with \s flag.在 Windows 中获取带有\s标志的 mysql 版本。

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

I was searching for this also (core dump issues connecting to mysql) and it seemed none of the above answers properly answered the question: eg mysql version info doesn't include the build type 32or 64 bit.我也在搜索这个(连接到mysql的核心转储问题),上面的答案似乎都没有正确回答这个问题:例如mysql版本信息不包括构建类型32或64位。

found this capttofu: Do I have a 32-bit or 64-bit MySQL?发现这个 capttofu:我有 32 位还是 64 位 MySQL? captoflu which uses a simple "file" command to tell what build youre running, in my case. captoflu它使用一个简单的“文件”命令来告诉你正在运行什么构建,在我的例子中。

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

No login is needed (OS X 10.11).无需登录(OS X 10.11)。

$ /usr/local/mysql/bin/mysqld --version

Use @@version server variable.使用@@version服务器变量。

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 .这是所有服务器变量的列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM