当你接手某个mysql数据库管理时,首先你需要查看维护的mysql数据库版本;当开发人员问你mysql数据库版本时,而恰好你又遗忘了,那么此时也需要去查看mysql数据库的版本..............。下文总结一下Linux平台下查看mysql数据库的方法.个人觉得总结的比较全面了。

方法1:登录数据库时,你可以看到对应mysql数据库的版本信息,如下所示:

[root@DB-Server ~]# mysql -u root -p

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.6.19 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

 

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数据库版本。

mysql> select version();

+-----------+

| version() |

+-----------+

| 5.6.19    |

+-----------+

1 row in set (0.00 sec)

 

 

mysql> select @@version;

+-----------+

| @@version |

+-----------+

| 5.6.19    |

+-----------+

1 row in set (0.00 sec)

 

mysql> 

 

方法3:使用status命令查看,如下所示,查看Server version后内容。

mysql> status

--------------

mysql  Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using  EditLine wrapper

 

Connection id:          3

Current database:

Current user:           root@localhost

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ''

Using delimiter:        ;

Server version:         5.6.19 MySQL Community Server (GPL)

Protocol version:       10

Connection:             Localhost via UNIX socket

Server characterset:    latin1

Db     characterset:    latin1

Client characterset:    utf8

Conn.  characterset:    utf8

UNIX socket:            /var/lib/mysql/mysql.sock

Uptime:                 2 hours 33 min 14 sec

 

Threads: 1  Questions: 22  Slow queries: 0  Opens: 67  Flush tables: 1  Open tables: 60  Queries per second avg: 0.002

--------------

 

方法4:使用mysql -V命令查看

 

[root@DB-Server ~]# mysql -V

mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper

[root@DB-Server ~]# mysql --version

mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper

方法5:在mysql --help命令内容中查找

 

[root@DB-Server ~]# mysql --help | grep Distrib

mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper

方法6:通过rpm命令查看安装包得知mysql数据库版本

 

[root@DB-Server ~]# rpm -qa | grep -i mysql

MySQL-client-5.6.19-1.rhel5

MySQL-server-5.6.19-1.rhel5

[root@DB-Server ~]#

方法7:SHOW VARIABLES 命令查看

mysql> SHOW VARIABLES LIKE "%version%";

+-------------------------+------------------------------+

| Variable_name           | Value                        |

+-------------------------+------------------------------+

| innodb_version          | 5.6.19                       |

| protocol_version        | 10                           |

| slave_type_conversions  |                              |

| version                 | 5.6.19                       |

| version_comment         | MySQL Community Server (GPL) |

| version_compile_machine | x86_64                       |

| version_compile_os      | Linux                        |

+-------------------------+------------------------------+

7 rows in set (0.00 sec)

 

mysql> 

 

方法8: mysqladmin -uroot -p -hlocalhost version 命令查看mysql数据库版本。其实这个方法也可以归为方法1

 

[root@DB-Server ~]# mysqladmin -uroot -p -hlocalhost version;

Enter password: 

mysqladmin  Ver 8.42 Distrib 5.6.19, for Linux on x86_64

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Server version          5.6.19

Protocol version        10

Connection              Localhost via UNIX socket

UNIX socket             /var/lib/mysql/mysql.sock

Uptime:                 2 hours 57 min 53 sec

 

Threads: 1  Questions: 42  Slow queries: 0  Opens: 67  Flush tables: 1  Open tables: 60  Queries per second avg: 0.003

 

参考资料:

http://dev.mysql.com/doc/refman/5.0/en/installation-version.html

http://www.cnblogs.com/end/archive/2011/10/18/2216461.html

查看mysql数据库版本方法总结的更多相关文章

  1. 三种查看MySQL数据库版本的方法

    https://blog.csdn.net/hj7jay/article/details/51921504 1.使用-V参数 首先我们想到的肯定就是查看版本号的参数命令,参数为-V(大写字母)或者-- ...

  2. 查看Mysql数据库版本

    一.使用终端 1.参数为-V(大写字母)或者--version 使用方法: D:\mysql\bin>mysql -V 或者 D:\mysql\bin>mysql --version

  3. 用Navicat Premium快速查看mysql数据库版本信息

    在出现的界面输入命令  select version();

  4. CentOS6.8下MySQL数据库版本信息查看

    方法1:使用mysql -v命令查看: [root@yeebian mysql]# mysql -V mysql Ver 14.14 Distrib 5.1.73, for redhat-linux- ...

  5. Centos下查看mysql的版本

    判断是否安装了mysql 输入 whereis mysql   如果安装了会显示mysql的安装所在路径 方法1:使用mysql -v命令查看: 1 2 3 4 [root@yeebian mysql ...

  6. 如何查看MySQL数据库的版本

    如何查看MySQL数据库的版本 一.总结 一句话总结: SQL语句:select version(); 命令行:mysql -V 或 mysql --version 二.三种方法查看MySQL数据库的 ...

  7. Linux下重启mysql数据库的方法

    原文地址:Linux下重启mysql数据库的方法作者:于士博的视频教程 方法一: 命令: [root@localhost /]# /etc/init.d/mysql   start|stop|rest ...

  8. C#访问MySQL数据库的方法

    C#访问MySQL数据库的方法 (1)首先需要下载C#访问MySQL数据库的ADO.NET驱动程序 下载地址为: http://dev.mysql.com/downloads/connector/ne ...

  9. SQL命令查看Mysql数据库大小

    SQL命令查看Mysql数据库大小的方法. 要想知道每个数据库的大小的话,步骤如下:1.进入information_schema 数据库(存放了其他的数据库的信息)use information_sc ...

随机推荐

  1. gulp自动化构建工具

    gulp    自动化构建工具,实时监控.代码合并.压缩... http://www.gulpjs.com.cn/     中文网 http://gulpjs.com/plugins/     英文网 ...

  2. 如何做优化,UITabelView才能更加顺滑 (转载)

    这篇文章是前两周@叶孤城叶大在微信群里面的分享,一直到这两天才翻出来研究.很多实用的东西,不过由于水平有限,有些地方没能翻译好,还请大家指正. 我已经在iOS这个最好的移动平台上有几年的开发经验了.在 ...

  3. 第一章 Linux內核簡介

    1. Linux是類Unix系統,但他不是Unix. 儘管Linux借鑑了Unix的許多設計並且實現了Unix的API(由Posix標準和其他Single Unix Specification定義的) ...

  4. Android 数据库框架OrmLite的使用(二)

    前面说了OrmLite的基本使用,现在说下更规范的做法以及常用的一些功能. 1.DatabaseHelper package com.example.ormlite.db; import java.s ...

  5. 相克军_Oracle体系_随堂笔记015-网络原理及配置

    oracle网络没有负载, 没有负载的就不容易出问题.相对很简单的.   1.监听的动态注册: PMON 注册监听,或者 alter system register; 强制PMON抓紧注册. 都属于动 ...

  6. 【LeetCode】Palindrome Pairs(336)

    1. Description Given a list of unique words. Find all pairs of distinct indices (i, j) in the given ...

  7. solr教程

    转载请注明出处:http://www.cnblogs.com/zhuxiaojie/p/5764680.html 本教程基于solr5.5 前言 至于为什么要用solr5.5,因为最新的6.10,没有 ...

  8. jQuery-1.9.1源码分析系列(十) 事件系统——事件委托

    jQuery的事件绑定有几个比较优秀的特点: 1. 可以绑定不限数量的处理函数 2. 事件可以委托到祖先节点,不必一定要绑到对应的节点,这样后添加的节点也照样能被处理. 3. 链式操作 下面主要分析事 ...

  9. springmvc处理上传图片代码(校验图片尺寸、图片大小)

    package com.maizuo.web.controller; import com.maizuo.domain.Result; import com.maizuo.util.Constants ...

  10. WPF老矣,尚能饭否——且说说WPF今生未来(中):策略

    本文接上文<WPF老矣,尚能饭否——且说说WPF今生未来(上):担心>继续. “上篇”中部分精彩的点评: 虽然WPF不再更新了,但是基于WPF的技术还是在发展着,就比如现在的WinRT,只 ...