0


查看mysql的版本

1. mysql --version

linux下使用命令:

mysql --version

在这里插入图片描述

2. mysql -V

没有连接到MySQL服务器,就想查看MySQL的版本。打开cmd,切换至mysql的bin目录,运行下面的命令即可:

2.1 mysql -V

e:\mysql\bin> mysql -V
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)

2.2 mysql -v

e:\mysql\bin> mysql -v

这个命令可以查看到更为详细的信息,因为它会用账号 ODBC,连接上MySQL服务器,默认连接到localhost上的mysql端口。

2.3 mysql --help | find “Distrib”

e:\mysql\bin> mysql --help | find “Distrib”
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)

这种方式只有windows系统下才可用,因为windows中才用find命令查找字符串,且后面的字符串必须用双引号包裹起来,而linux系统下虽然也是用 | 作为管道符,却是使用grep命令查找字符串(如: mysql --help | grep Distrib)。

3.select version();

连接到了MySQL服务器,支持Windows和linux操作系统,运行下面的命令:

mysql> select version();
或者:
mysql> status;
或者
mysql> \s

3.1 select version();

在这里插入图片描述

3.2 status;

在这里插入图片描述

3.3 \s

在这里插入图片描述

4. mysql -uroot -p

在命令行连接上MySQL服务器时,其实就已经显示了MySQL的版本,如:

命令:

mysql -uadmin -p
或者
mysql -u admin -p

执行之后的结果:

[root@host***** netconf]# mysql -uadmin -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2594
Server version: 8.0.31 MySQL Community Server - GPL
Copyright © 2000, 2022, Oracle and/or its affiliates.
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>

标签: mysql 数据库 windows

本文转载自: https://blog.csdn.net/MissOfSpring/article/details/128001671
版权归原作者 Spring的思念 所有, 如有侵权,请联系我们删除。

“查看mysql的版本”的评论:

还没有评论