Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux basic command-mysqladmin database management tool

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

mysqladmin

mysqladmin is a mysql database management tool that can control, view, and modify the configuration and status of the database server.

This command applies to Red Hat, RHEL, Ubuntu, CentOS, Fedora.

1. Grammar

mysqladmin [options] command [command-options] [command [command-options]]

2. Option parameter list

option

description

- ?| --help

display help information

--bind-address = ip

Binding ip, when the computer has multiple network cards, you can specify the network card when mysql is connected

--character-sets-dir = path

Specifies the directory in which the character set resides

-c | --compress

Data compression between server and client

--default-character-set = chatset

Default character set

-f | --force

enforcement

-b | --no-beep

Close Error Alert

-W | --pipe

Connect databases using named pipes

-P port | --port =

Port used to connect to database

--protocol =TCP|SOCKET|PIPI|MEMORY

Protocol used to connect to database

-s | --silent

Output short content

-v | --verbose

Show detailed execution process

-V | --version

output version information

-w | --wait

latency

-u

specify a user name

-p

specify a password

mysqladmin supports the following commands

option

description

create

create a database

debug

Turn on debug mode

drop

delete database

extend-status

Display mysql extended status information

flush-hosts

Flushing mysql buffered hosts

flush-logs

refresh log

flush-status

refresh status variable

flush-privileges

Refresh permissions

flush-table

Refresh all tables

flush-threads

refresh thread

kill

Kill the specified thread

password

change the password

ping

Test whether the server is connectable

processlist

Show active threads

reload

Reload authorization table

refresh

Refresh all tables and close and open log files

shutdown

shut down the server

status

Show server status

start-slave

Start slave

stop-slave

Close slave

variables

Show available variables and values

version

output version information

3. Examples

1) Display server status

[root@localhost ~]# mysqladmin -u root -p status

Enter password:

Uptime: 1501 Threads: 1 Questions: 32 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.21

2) View active threads

[root@localhost ~]# mysqladmin -u root -p processlist

Enter password:

+----+------+-----------+----+---------+------+-------+------------------+

| Id | User | Host | db | Command | Time | State | Info |

+----+------+-----------+----+---------+------+-------+------------------+

| 7 | root | localhost | | Query | 0 | | show processlist |

+----+------+-----------+----+---------+------+-------+------------------+

3) Display server version information

[root@localhost ~]# mysqladmin -u root -p version

Enter password:

mysqladmin Ver 8.42 Distrib 5.1.71, for redhat-linux-gnu on i386

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.

Server version 5.1.71

Protocol version 10

Connection Localhost via UNIX socket

UNIX socket /var/lib/mysql/mysql.sock

Uptime: 26 min 13 sec

Threads: 1 Questions: 33 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.20

Made a Linux learning platform, currently out of a prototype, you can refer to the use

Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ Password:n7bk

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report