每两秒显示一下MySQL的状态,一共显示5次。

# mysqladmin -uroot -p -i 2 -c 5 status

查看MySQL的运行状态:

#mysqladmin -uroot -p ping

mysqladmin Ver 8.42 Distrib 5.1.73, for redhat-linux-gnu on x86_64
Copyright (c) 2000, 2013, 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.

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command....

-c number 自动运行次数统计,必须和 -i 一起使用

-i   number 间隔多长时间重复执行
-c, --count=# Number of iterations to make. This works with -i
(--sleep) only.
--debug-check Check memory and open file usage at exit.
--debug-info Print some debug info at exit.
-f, --force Don't ask for confirmation on drop database; with
multiple commands, continue even if an error occurs.
-C, --compress Use compression in server/client protocol.
--character-sets-dir=name
Directory for character set files.
--default-character-set=name
Set the default character set.
-?, --help Display this help and exit.
-h, --host=name Connect to host.
-b, --no-beep Turn off beep on error.
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's asked from the tty.
-P, --port=# Port number to use for connection or 0 for default to, in
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/services, built-in default (3306).
--protocol=name The protocol to use for connection (tcp, socket, pipe,
memory).
-r, --relative Show difference between current and previous values when
used with -i. Currently only works with extended-status.
-O, --set-variable=name
Change the value of a variable. Please note that this
option is deprecated; you can set variables directly with
--variable-name=value.
-s, --silent Silently exit if one can't connect to server.
-S, --socket=name The socket file to use for connection.
-i, --sleep=# Execute commands repeatedly with a sleep between.
--ssl Enable SSL for connection (automatically enabled with
other flags).Disable with --skip-ssl.
--ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
--ssl).
--ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).
--ssl-cert=name X509 cert in PEM format (implies --ssl).
--ssl-cipher=name SSL cipher to use (implies --ssl).
--ssl-key=name X509 key in PEM format (implies --ssl).
--ssl-verify-server-cert
Verify server's "Common Name" in its cert against
hostname used when connecting. This option is disabled by
default.
-u, --user=name User for login if not current user.
-v, --verbose Write more information.
-V, --version Output version information and exit.
-E, --vertical Print output vertically. Is similar to --relative, but
prints output vertically.
-w, --wait[=#] Wait and retry if connection is down.
--connect_timeout=#
--shutdown_timeout=#

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
count 0
debug-check FALSE
debug-info FALSE
force FALSE
compress FALSE
character-sets-dir (No default value)
default-character-set (No default value)
host (No default value)
no-beep FALSE
port 0
relative FALSE
socket (No default value)
sleep 0
ssl FALSE
ssl-ca (No default value)
ssl-capath (No default value)
ssl-cert (No default value)
ssl-cipher (No default value)
ssl-key (No default value)
ssl-verify-server-cert FALSE
user (No default value)
verbose FALSE
vertical FALSE
connect_timeout 43200
shutdown_timeout 3600

Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
The following groups are read: mysqladmin client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
--defaults-file=# Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.

Where command is a one or more of: (Commands may be shortened)
create databasename Create a new database
debug Instruct server to write debug information to log
drop databasename Delete a database and all its tables
extended-status Gives an extended status message from the server
flush-hosts Flush all cached hosts
flush-logs Flush all logs
flush-status Clear status variables
flush-tables Flush all tables
flush-threads Flush the thread cache
flush-privileges Reload grant tables (same as reload)
kill id,id,... Kill mysql threads
password new-password Change old password to new-password, MySQL 4.1 hashing.
old-password new-password Change old password to new-password in old format.

ping Check if mysqld is alive
processlist Show list of active threads in server
reload Reload grant tables
refresh Flush all tables and close and open logfiles
shutdown Take server down
status Gives a short status message from the server
start-slave Start slave
stop-slave Stop slave
variables Prints variables available
version Get version info from server

MySQL工具1:mysqladmin的更多相关文章

  1. mysql 连接出错 'mysqladmin flush-hosts'

    本文章 转载于: http://blog.itechol.com/space-33-do-blog-id-5670.html    求助QQ:499628121   环境说明:   内网测试服务器19 ...

  2. MySQL 工具

    MySQL 客户端工具: 1:mysql       #mysql的功能和Oracle的sqlplus一样,它为用户提供一个命令行接口来管理Mysql服务器. 2:mysqladmin #mysqla ...

  3. mysql工具的使用、增删改查

    mysql工具使用 目录 mysql工具使用 mysql的程序组成 mysql工具使用 服务器监听的两种socket地址 mysql数据库操作 DDL操作 数据库操作 表操作 用户操作 查看命令SHO ...

  4. mysql工具

    MySQL工具汇总 收录了MySQL相关有用的工具.工具包含:性能测试,状态分析,SQL路由等方面 本文汇总了和MySQL运维开发相关的所有工具,并会持续更新 工具套件集 percona-toolki ...

  5. MySQL工具:管理员必备的10款MySQL工具

    MySQL是一个复杂的的系统,需要许多工具来修复,诊断和优化它.幸运的是,对于管理员,MySQL已经吸引了很多软件开发商推出高品质的开源工具来解决MySQL的系统的复杂性,性能和稳定性,其中大部分是免 ...

  6. mysql工具——perror(mysql错误代码,查看错误号释义)

    mysql工具——perror(mysql查看错误代码,查看错误号释义) 关键词:mysql错误代码,mysql错误号,perror

  7. mysql 开发进阶篇系列 32 工具篇(mysqladmin工具)

    一.概述 mysqladmin是一个执行管理操作的客户端程序.用来检要服务的配置和当前的状态,创建并删除数据库等.功能与mysql客户端类似,主要区别在于它更侧重于一些管理方面的功能.1. 查找mys ...

  8. 主流 SQLServer 迁移到 MySQL 工具对比

    首次需要数据转换是测试环节,当时为了快速验证新研发云产品性能与结果准确性(算法类),所以需大量的原始数据,最快的办法就是使用老产品的真实数据.因为在前期数据转换时主用于内部验证,并没有花很多心思去处理 ...

  9. 各种主流 SQLServer 迁移到 MySQL 工具对比

          我之所以会写这篇对比文章,是因为公司新产品研发真实经历过这个痛苦过程(传统基于SQL Server开发的C/S产品转为MySQL云产品).首次需要数据转换是测试环节,当时为了快速验证新研发 ...

随机推荐

  1. Centos安装Perforce

    Author: JinDate: 20140827System: CentOS release 6.5 (Final) 参考:http://www.cnblogs.com/itech/archive/ ...

  2. transform,transition,animation 的混合使用——进阶

    今天我们来讲述css3能够做成动画的最小独立单元,并且讲述如何使用这些独立的单元来构成一个‘高大尚’的组合动画. 这是我在网上找的一个案例,修改后的效果图,虽说不是特别的‘高大尚’,但我认为这也跟高大 ...

  3. 深入浅出VC++串口编程之基于Win32 API

    1.API描述 在WIN32 API中,串口使用文件方式进行访问,其操作的API基本上与文件操作的API一致. 打开串口 Win32 中用于打开串口的API 函数为CreateFile,其原型为: H ...

  4. 具体解释Ajax技术

    Ajax 可以做什么? 现在 Google Suggest 和 Google Maps 使用了 Ajax,通过 Ajax,我们能够使得client得到丰富的应用体验及交换操作,而用户不会感觉到有网页提 ...

  5. 委托、多播委托、泛型委托Func,Action,Predicate,ExpressionTree

    当试图通过一个事件触发多个方法,抽象出泛型行为的时候,或许可以考虑使用委托.     通过委托构造函数或委托变量把方法赋值给委托 private delegate double DiscountDel ...

  6. 用Redis实现分布式锁以及redission使用

    原文:https://my.oschina.net/wangnian/blog/668830 前言:分布式环境有很多问题,比如你前一个请求访问的是服务器A,第二个请求访问到了服务器B,就会发生并发重复 ...

  7. 【docker】docker容器和宿主机之间文件互传,互相拷贝

    原文地址:https://www.cnblogs.com/areyouready/p/8973495.html [注意:命令中符号均为英文符号] 1.从容器里面拷文件到宿主机 答:在宿主机里面执行以下 ...

  8. pythonUnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 108: ordinal not in range(128

    今天做网页到了测试和数据库交互的地方,其中HTML和数据库都是设置成utf-8格式编码,插入到数据库中是正确的,但是当读取出来的时候就会出错,原因就是Python的str默认是ascii编码,和uni ...

  9. 分布式缓存系统Memcached在Asp.net下的应用

    Memcached 是一个高性能的分布式内存对象缓存系统.用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来降低读取数据库的次数,从而提高动态.数据库驱动站点的速度. Memcache ...

  10. [4] 圆锥(Cone)图形的生成算法

    顶点数据的生成 bool YfBuildConeVertices ( Yreal radius, Yreal height, Yuint slices, YeOriginPose originPose ...