LinuxEye - Linux系统教程

LinuxEye - Linux系统教程

当前位置: 主页 > 数据库 >

mysqladmin的用法简介

时间:2013-05-07 22:04来源:未知 编辑:admin 点击:
mysqladmin MySQL客户端管理工具 flush-hosts Flush all cached hosts (max_connect_errors) 刷新主机缓冲中的所有信息 flush-logs Flush all logs 刷新所有日志 flush-status Clear status variables 清除状态变量 flush-tabl
mysqladmin  MySQL客户端管理工具

flush-hosts           Flush all cached hosts (max_connect_errors)
                        刷新主机缓冲中的所有信息
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)
create db_name        Create a new database named db_name.
debug                 Tell the server to write debug information to the error log.
drop db_name          Delete the database named db_name and all its tables.
extended-status       Display the server status variables and their values.
kill id,id,...
old-password new-password    修改密码
password new-password        设置一个新密码
 
-------------------------------------------------------------------------
# mysqladmin -uroot password admin      给root设置一个密码
# mysqladmin -uroot -p proc stat    查看Mysql的状态值
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host      | db | Command | Time | State | Info             |
+----+------+-----------+----+---------+------+-------+------------------+
| 8  | root | localhost |    | Query   | 0    |       | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
Uptime: 148  Threads: 1  Questions: 8  
Slow queries: 0  Opens: 33  Flush tables: 1  
Open tables: 26  Queries per second avg: 0.054
Uptime     --> MySQL服务器已经运行的秒数
Threads    --> 活动线程(客户)的数目
Questions    --> 服务器启动以来客户的问题(查询)数目
Slow Query    --> 执行时间超过long_query_time秒的查询的数量
Opens    --> 服务器已经打开的数据库表的数量
Flush tables    --> 服务器已经执行的flush ...、refresh和reload命令的数量
Open tables    --> 目前打开的表的数量

# mysqladmin -uroot -padmin version  --> 通过mysqladmin查看数据库版本
mysqladmin  Ver 8.42 Distrib 5.5.29, for Linux on i686
Copyright (c) 2000, 2012, 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.5.29-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /data/mysql/mysql.sock
Uptime:                 46 days 6 hours 37 min 25 sec

Threads: 17  Questions: 8813917  Slow queries: 0  Opens: 124531  Flush tables: 1  Open tables: 64  Queries per second avg: 2.204

转载请保留固定链接: https://linuxeye.com/database/1591.html

------分隔线----------------------------
标签:mysqladmin
栏目列表
推荐内容