MYSQL入门学习之十八:MYSQLADMIN命令参数详解(三)

2014-11-24 15:36:18 · 作者: · 浏览: 4
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. 显示MYSQLADMIN的版本
-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=# 超时关闭 示例:
[sql]
C:\Users\qxl>mysqladmin -uroot -E -i 3 -c 2 status
Uptime: 1590 Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second
avg: 0.3
Uptime: 1593 Threads: 1 Questions: 5 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second
avg: 0.3
C:\Users\qxl>mysqladmin -V
mysqladmin Ver 8.42 Distrib 5.1.28-rc, for Win32 on ia32
第二部分为mysqladmin的相关变量。
第三部分为mysqladmin可以执行的相关服务器命令,详细说明如下:
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) 再次装载授权表(同reload)
kill id,id,... Kill mysql threads 杀死mysql线程
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 检查mysqld是否在线
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 启动slave
stop-slave Stop slave 关闭slave
variables Prints variables available 打印出可用变量
version Get version info from server 得到服务器的版本信息
示例:
[sql]
C:\Users\qxl>mysqladmin -uroot version
mysqladmin Ver 8.42 Distrib 5.1.28-rc, for Win32 on ia32
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 5.1.28-rc-community
Protocol version 10
Connection localhost via TCP/IP
TCP port 3306
Uptime: 31 min 3 sec
Threads: 1 Questions: 23 Slow queries: 0 Opens: 16 Flush tables: 2 Open tables: 0 Queries per second avg: 0.12
C:\Users\qxl>mysqladmin -u root -p create test_admin
Enter password:
C:\Users\qxl>mysqladmin -u root -p drop test_admin
Enter password:
Dropping the database is potentially a very bad thing to do.
Any data stored in the dat