Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 67971
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, 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>
E:\>mysql -u root -p
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1026
Server version: 5.6.34-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> select @@version;
+------------+
| @@version |
+------------+
| 5.6.34-log |
+------------+
1 row in set (0.00 sec)
18 回答
试试这个功能 -
VERSION()
或者更多细节使用:
MySQL 5.0 Reference Manual (pdf) - Determining Your Current MySQL Version - page 42
尝试
例如 . 或
dpkg -l 'mysql-server*'
.在Ubuntu上使用
mysql -V
对我来说很好用 .对于UBUNTU,您可以尝试以下命令来检查mysql版本:
我发现了一种简单的方法 .
示例:Unix命令(这样您不需要2个命令 . ),
样本输出:
在上面的例子中,mysql版本是 5.5.49 .
请找this useful reference .
MySQL 5.0 Reference Manual (pdf) - Determining Your Current MySQL Version - page 42
mysqladmin version
或mysqladmin -V
从控制台你可以尝试:
只需登录Mysql即可
然后输入此命令
这将给出结果,
登录到你的mysql,复制并粘贴这个:
样本输出:
CLI在一行中:
mysql --user=root --password=pass --host=localhost db_name --execute='select version()';
要么
mysql -uroot -ppass -hlocalhost db_name -e 'select version()';
返回这样的东西:
您还可以在首次登录时查看MySQL shell的顶部 . 它实际上显示了那里的版本 .
在Ubuntu和其他linux varian上试过这个,
SELECT @@version
并且运行得很好 .在windows中,获取cmd并键入MySQL -V或MySQL --version
如果你使用Linux获取终端并输入MySQL -v
Mysql客户端版本:
Mysql服务器版:有很多方法可以找到
SELECT version();
SHOW VARIABLES LIKE "%version%";
对于Mac,
登录mysql服务器 .
执行以下命令: