mysql 查看版本
mysql 查看版本是怎样的呢?下面就让我们一起来了解一下吧:
mysql查看版本的方法主要有四种,具体介绍如下:
1、若是没有连接到MySQL终端下可以直接使用mysql命令,即打开cmd,切换至MySQL的bin目录,示例代码为:
[root@localhost lib]# mysql -V
mysql Ver 15.1 Distrib 5.5.47-MariaDB, for Linux (x86_64) using readline 5.1
2、直接在终端使用命令,示例代码为:
[root@localhost lib]# mysql --help | grep Distrib
mysql Ver 15.1 Distrib 5.5.47-MariaDB, for Linux (x86_64) using readline 5.1
3、若是已经连接到了MySQL ,那么可在登陆mysql之后使用内置命令,示例代码为:
mysql> select version();
+----------------+
| version() |
+----------------+
| 5.5.47-MariaDB |
+----------------+
1 row in set (0.00 sec)
4、直接登录MySQL,然后使用内置命令,示例代码为:
mysql> status;
--------------
mysql Ver 15.1 Distrib 5.5.47-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 4
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 5.5.47-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: arb/mysql/mysql.sock
Uptime: 2 min 56 sec
Threads: 1 Questions: 12 Slow queries: 0 Opens: 0 Flush tables: 2 Opentables: 4 Queries per second avg: 0.068
希望能够帮助到大家