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

发布于 2024-11-29 11:24:57 字数 46 浏览 1 评论 0原文

我可以使用终端知道我正在运行的 MySQL 版本(32 位还是 64 位)吗?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

萌吟 2024-12-06 11:24:57
$ 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
--------------
$ 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
--------------
向地狱狂奔 2024-12-06 11:24:57

在命令行中运行此命令:

mysql> show variables like 'version_compile_machine';

然后您会得到类似以下内容:

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

然后请检查: http://www.redhat.com/archives/rhl-list/2006-October/msg03684.html

你会看到i386/i686 是 32 位,x86_64 是 64 位。

希望这有帮助。

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.

oО清风挽发oО 2024-12-06 11:24:57

您可以使用 version()

SELECT version();

在此处查看更多信息:)

You can use version():

SELECT version();

See more information here :)

感情洁癖 2024-12-06 11:24:57

运行命令行 MySQL 客户端:

mysql> select version();

OR

mysql> \s

这是以下命令的别名:

mysql> status

Running the command-line MySQL client:

mysql> select version();

OR

mysql> \s

which is an alias for:

mysql> status
月亮坠入山谷 2024-12-06 11:24:57

您可以尝试以下命令:(无需登录)

mysql -V

You could try the command: (no login needed)

mysql -V
ι不睡觉的鱼゛ 2024-12-06 11:24:57

要了解您的 Mysql 位架构,请按照此步骤操作。
从 phpmyadmin 打开 Mysql 控制台

现在输入密码后输入此命令

显示全局变量,如“version_compile_machine”;

如果 version_compile_machine = x86_64 那么它是 64 位,

否则是 32 位。

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.

固执像三岁 2024-12-06 11:24:57

我也在寻找这个(连接到 mysql 的核心转储问题),上面的答案似乎都没有正确回答问题:例如 mysql 版本信息不包括构建类型 32 或 64 位。

发现这个 capttofu:我有 32 位还是 64 位 MySQL? 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

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
孤凫 2024-12-06 11:24:57

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

在 Windows 中使用自定义查询获取 mysql 版本:

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

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

mysql>

使用服务器变量在 Windows 中获取 mysql 版本:

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

mysql>

使用 \s 标志在 Windows 中获取 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
--------------

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
--------------
樱花落人离去 2024-12-06 11:24:57

使用@@version 服务器变量。

select @@version;

这是在我的服务器上得到的:

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

希望它有帮助。

这是所有服务器变量的列表

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.

温暖的光 2024-12-06 11:24:57

无需登录(OS X 10.11)。

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

No login is needed (OS X 10.11).

$ /usr/local/mysql/bin/mysqld --version
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文