哪个命令返回MySQL数据库的当前版本?


当前回答

mysqladmin版本或mysqladmin -V

其他回答

try

mysql --version

例如。或dpkg -l 'mysql-server*'。

从控制台你可以尝试:

mysqladmin version -u USER -p PASSWD
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)

mysqladmin版本或mysqladmin -V

使用mysql -V对我来说在Ubuntu上很好。