查看mysql版本

ubuntu查看mysql版本的几种方法

mysql 

1:在终端下:mysql -V(大写)

//代码
$ mysql -V
mysql  Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (i686) using readline 6.3

  2:在mysql中:mysql> status;(引号要加)

 //代码

进入mysql
1.没有用户的
$ mysql -u root 
2.有用户的
$ mysql -u root -p
然后输入用户名和密码
进入之后:

mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (i686) using readline 6.3

Connection id:		50
Current database:	
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		\'\'
Using delimiter:	;
Server version:		5.5.46-0ubuntu0.14.04.2 (Ubuntu)
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	latin1
Db     characterset:	latin1
Client characterset:	utf8
Conn.  characterset:	utf8
UNIX socket:		/var/run/mysqld/mysqld.sock
Uptime:			7 hours 23 min 47 sec

Threads: 1  Questions: 128  Slow queries: 0  Opens: 48  Flush tables: 1  Open tables: 41  Queries per second avg: 0.004
--------------

mysql>

 3:在help里面查找

 //代码

$ mysql --help | grep Distrib
mysql  Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (i686) using readline 6.3

  4:使用mysql的函数

 //代码

1进入mysql
方法(见上)
2.命令
mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 5.5.46-0ubuntu0.14.04.2 |
+-------------------------+
1 row in set (0.00 sec)

mysql>

版权声明:本文为zlsgh原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/zlsgh/p/8645589.html