MySQL工具1:mysqladmin

每两秒显示一下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

时间: 2024-10-30 18:34:48

MySQL工具1:mysqladmin的相关文章

MySQL Study之--mysqladmin工具应用

MySQL Study之--mysqladmin工具应用 1.查看mysql server是否启动 [[email protected] ~]# mysqladmin -u root -p ping Enter password: mysqld is alive 2.查看mysql server版本 [[email protected] ~]# mysqladmin -u root -p versionEnter password: mysqladmin  Ver 8.42 Distrib 5.

MySQL工具汇总

本文汇总了和MySQL运维开发相关的所有工具,并会持续更新 1. 工具套件集 percona-toolkit: http://www.percona.com/software/percona-toolkit oak-toolkit: http://code.openark.org/forge/openark-kit ps-helper(performance schema 工具函数集):https://github.com/MarkLeith/dbahelper 2. MySQL 实时状态分析

mysql工具

MySQL工具汇总 收录了MySQL相关有用的工具.工具包含:性能测试,状态分析,SQL路由等方面 本文汇总了和MySQL运维开发相关的所有工具,并会持续更新 工具套件集 percona-toolkit oak-toolkit ps-helper(performance schema 工具函数集) MySQL 实时状态分析 innotop orzdba mytop systemtap工具示例集 mysql客户端&开发工具 MySQL Workbench SQLyog Adminer MyQuer

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

MySQL是一个复杂的的系统,需要许多工具来修复,诊断和优化它.幸运的是,对于管理员,MySQL已经吸引了很多软件开发商推出高品质的开源工具来解决MySQL的系统的复杂性,性能和稳定性,其中大部分是免费提供的社区. 从单机到多个节点的环境,以下10个开源工具,对于使用MySQL的任何一个人都是比较管用的.该列表已经考虑到了各种编译.你会发现这些工具,可以帮助备份MySQL数据,提高性能,防止数据偏差,并在出现问题时记录相关的故障排除数据.   MySQL 工具1: mk-query-digest

MySQL Study之--MySQL工具mysqlshow

 MySQL Study之--MySQL工具mysqlshow mmysqlshow客户可用来很快地查找存在哪些数据库,数据库中的表,表中的列或索 mysqlshow为一些SQL显示语句提供了一个命令行界面.相同的信息可以通过直接使用那些语句获得.例如,你可以从mysql客户程序发出它们. 象这样调用mysqlshow: shell> mysqlshow[选项] [db_name [tbl_name [col_name]] 如果没有给出数据库,显示所有匹配的数据库. 如果没有给出表,显示数据库中

mysql工具导出数据库表数据

步骤1:首先,打开数据库工具,mysql的可视化工具navicat for mysql工具.进入到源数据库系统中. 步骤二:找到对应的数据库表 步骤三:找到要导出来的表,右击该表,再点击[导出向导] 步骤四:选择你导出的告格式,点击下一步 步骤五: 点击下一步 步骤六:一直点击下一步,直达 步骤七:点击开启,看到success就表示你导出数据成功了 原文地址:https://www.cnblogs.com/zhouyuqiu/p/12186530.html

mysql下载,安装及在Navicat for MySQL工具上连接的问题

之前一直使用的是mysql的数据库,所以总觉得对mysql的安装使用是手到擒来的事,但是因为最近需要重新安装mysql突然发现了很多问题(有点打脸).事实证明还是有必要记录一下的.这里面我归纳了一下网上的方法和我自己的总结. *************************************************************************************** Mysql的下载: 下载mysql:https://dev.mysql.com/downloads

[转]sqlserver转换为Mysql工具使用

https://files.cnblogs.com/files/miantiaoandrew/mss2sql_v5-3.zip 1.首先下载工具,链接如上 2.解压出来,运行mss2sql.exe 3.一共两个选项,这里选择第一项,直接移动到Mysql服务器 4.填写Sql Server的链接信息,这里直接使用 "." (点),进行本机windows登陆方式进行链接,远程服务器的话就自己填写IP .用户名.密码吧 5.填写Mysql的链接信息,Access mode(访问模式,这里选择

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

我之所以会写这篇对比文章,是因为公司新产品研发真实经历过这个痛苦过程(传统基于SQL Server开发的C/S产品转为MySQL云产品).首次需要数据转换是测试环节,当时为了快速验证新研发云产品性能与结果准确性(算法类),所以需大量的原始数据,最快的办法就是使用老产品的真实数据.因为在前期数据转换时主用于内部验证,并没有花很多心思去处理这个事情,一般数据能导过去,不对的地方自己再手工处理一下就好了.后面对这个转换工具引起了极大的重视是正式有老客户升级时,因为正式投入使用就容不得半点错误(当时至少