查看数据库MySQL的版本信息的命令语句
⽂章⽬录
⼀、mysql -V
[root@htlwk0001host ~]# mysql -V
mysql多个like模糊查询mysql  Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using  EditLine wrapper
注意:V 是⼤写
⼆、登录数据库后会显⽰版本信息
[root@htlwk0001host ~]# mysql -uroot -p
mysql语句转oracleEnter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 702
Server version: 5.7.31 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, 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.
如上所⽰ Server version: 5.7.31 MySQL Community Server (GPL) 这就是数据库的版本信息
三、mysqladmin -uroot -p version
[root@htlwk0001host /]# mysqladmin -uroot -p version
Enter password:
mysqladmin  Ver 8.42 Distrib 5.7.31, for Linux on x86_64
Copyright (c) 2000, 2020, 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
whiskowners.
Server version  5.7.31
Protocol version 10
Connection  Localhost via UNIX socket
UNIX socket  /var/lib/mysql/mysql.sock服务号开通
Uptime:  1 day 5 hours 41 min 13 sec
Threads: 21  Questions: 12030  Slow queries: 0  Opens: 114  Flush tables: 1  Open tables: 107  Queries per second avg: 0.112四、select version()
查询数据库的版本号
mysql>select version();
+-----------+
| version()|
+-----------+
|5.7.31|
+-----------+
1row in set(0.00 sec)
五、命令 status
mysql>status
--------------
mysql  Ver 14.14 Distrib 5.7.31,for Linux (x86_64)using  EditLine wrapper
Connection id:  1243
Current database:
Current user:  root@localhost
SSL:  Not in use
Current pager:  stdout
Using outfile:  ''
Using delimiter: ;
Server version:  5.7.31 MySQL Community Server (GPL)
Protocol version: 10
Connection:  Localhost via UNIX socket
Server characterset: utf8mb4
Db    characterset: utf8mb4
Client characterset: utf8mb4
Conn.  characterset: utf8mb4
UNIX socket:  /var/lib/mysql/mysql.sock
Uptime:  1day6 hours 16 min 37 sec
Threads: 21  Questions: 12273  Slow queries: 0  Opens: 114  Flush tables: 1Open tables: 107  Queries per second avg: 0.112 --------------
六、show variables like ‘%version%’
mysql>show variables like'%version%';
+-------------------------+------------------------------+
| Variable_name          |Value|
+-------------------------+------------------------------+网络编程实验心得
| innodb_version          |5.7.31|
| protocol_version        |10|
| slave_type_conversions  ||
| tls_version            | TLSv1,TLSv1.1,TLSv1.2|
| version                |5.7.31|
| version_comment        | MySQL Community Server (GPL)|
| version_compile_machine | x86_64                      |
| version_compile_os      | Linux                        |
django开发的网站
+-------------------------+------------------------------+
8rows in set(0.00 sec)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。