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>

转载于:https://www.cnblogs.com/zlsgh/p/8645589.html

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐