← 返回命令列表

Linux command

mysqladmin 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Check server status

mysqladmin -u [user] -p status

Create database

mysqladmin -u [user] -p create [database_name]

Drop database

mysqladmin -u [user] -p drop [database_name]

Change password

mysqladmin -u [user] -p password "[newpassword]"

Show variables

mysqladmin -u [user] -p variables

Show process list

mysqladmin -u [user] -p processlist

Shutdown server

mysqladmin -u [root] -p shutdown

Ping server

mysqladmin -u [user] -p ping

说明

mysqladmin is a command-line client for performing administrative operations on MySQL servers. It can check server status, create and drop databases, reload privileges, flush logs, and shut down the server. Common administrative tasks include checking if the server is alive (ping), viewing server variables and status counters (variables, extended-status), reloading grant tables after permission changes (flush-privileges), and monitoring active connections (processlist).

参数

-u _USER_
Username.
-p _PASSWORD_
Password.
-h _HOST_
Server hostname.
status
Show server status.
create _DB_
Create database.
drop _DB_
Drop database.
flush-privileges
Reload grant tables.
extended-status
Show server status variables.
--help
Display help information.

FAQ

What is the mysqladmin command used for?

mysqladmin is a command-line client for performing administrative operations on MySQL servers. It can check server status, create and drop databases, reload privileges, flush logs, and shut down the server. Common administrative tasks include checking if the server is alive (ping), viewing server variables and status counters (variables, extended-status), reloading grant tables after permission changes (flush-privileges), and monitoring active connections (processlist).

How do I run a basic mysqladmin example?

Run `mysqladmin -u [user] -p status` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -u _USER_ do in mysqladmin?

Username.