淡定哥头像

技术文档

查看mysql版本命令,mysql版本查看的四种方法

查看mysql版本命令,mysql版本查看的四种方法
1. 在终端下:mysql -V。 

iwang:java iwang$ mysql -V
mysql  Ver 14.14 Distrib 5.7.17, for macos10.12 (x86_64) using  EditLine wrapper


2. 在mysql命令行中输入: status 

mysql -uroot -p111111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 388
Server version: 5.7.17 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> status
--------------
mysql  Ver 14.14 Distrib 5.7.17, for macos10.12 (x86_64) using  EditLine wrapper

Connection id: 388
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.17 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db     characterset: latin1
Client characterset: utf8
Conn.  characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 1 day 21 hours 17 min 20 sec

Threads: 11  Questions: 4283  Slow queries: 0  Opens: 429  Flush tables: 1  Open tables: 396  Queries per second avg: 0.026
--------------


3. 在help里面查找
iwang:java iwang$ mysql --help | grep Distrib
mysql  Ver 14.14 Distrib 5.7.17, for macos10.12 (x86_64) using  EditLine wrapper


4. 使用mysql的函数: version()
iwang:java iwang$ mysql -uroot -p111111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 389
Server version: 5.7.17 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.7.17    |
+-----------+
1 row in set (0.00 sec)



分享到: 

* 发表评论:
Top