1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 查看数据库 MySQL 的版本信息的命令语句

查看数据库 MySQL 的版本信息的命令语句

时间:2019-04-11 07:20:06

相关推荐

查看数据库 MySQL 的版本信息的命令语句

文章目录

一、mysql -V二、登录数据库后会显示版本信息三、mysqladmin -uroot -p version四、select version()五、命令 status六、show variables like '%version%'

一、mysql -V

[root@htlwk0001host ~]# mysql -Vmysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper

注意:V 是大写

二、登录数据库后会显示版本信息

[root@htlwk0001host ~]# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 702Server version: 5.7.31 MySQL Community Server (GPL)Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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 versionEnter password: mysqladmin Ver 8.42 Distrib 5.7.31, for Linux on x86_64Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Server version5.7.31Protocol version10ConnectionLocalhost via UNIX socketUNIX socket/var/lib/mysql/mysql.sockUptime:1 day 5 hours 41 min 13 secThreads: 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 |+-----------+1 row in set (0.00 sec)

五、命令 status

mysql> status--------------mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapperConnection id:1243Current database:Current user:root@localhostSSL:Not in useCurrent pager:stdoutUsing outfile:''Using delimiter:;Server version:5.7.31 MySQL Community Server (GPL)Protocol version:10Connection:Localhost via UNIX socketServer characterset:utf8mb4Dbcharacterset:utf8mb4Client characterset:utf8mb4Conn. characterset:utf8mb4UNIX socket:/var/lib/mysql/mysql.sockUptime:1 day 6 hours 16 min 37 secThreads: 21 Questions: 12273 Slow queries: 0 Opens: 114 Flush tables: 1 Open 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 |+-------------------------+------------------------------+8 rows in set (0.00 sec)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。