mysql执行管理操作工具mysqladmin

mysqladmin是用于执行MySQL数据库管理操作的客户端工具,它能检查服务器状态、更改root密码、创建/删除数据库等。本文介绍了其使用格式及包括查看服务器状态、修改密码、显示进程、创建/查看数据库等在内的多项功能。
摘要由CSDN通过智能技术生成

一、功能

客户端执行管理操作mysql数据库的工具

二、应用演示

mysqladmin是一个执行管理操作的客户端程序。它可以用来检查服务器的配置和当前状态、创建和删除数据库等。
mysqladmin 工具的使用格式:mysqladmin [option] command [command option]command …option

option选项

  -c, --count=#       Number of iterations to make. This works with -i
                      (--sleep) only.
 
  -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.
  -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.
 
  -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.

1、查看服务器状态

[root@localhost ~]# mysqladmin -uroot -p status
Enter password:
Uptime: 388  Threads: 2  Questions: 3  Slow queries: 0  Opens: 131  Flush tables: 3  Open tables: 35  Queries per second avg: 0.007

2、修改root密码

[root@localhost ~]#  mysqladmin 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值