Mysql mysqladmin command usage

Source: Internet
Author: User
Tags mysql create mysql create table
Use shell to write a script to monitor the running status of the mysql process and test whether mysql can be connected. If not, send an email and send an alarm. As for how to monitor, there are actually many commands. For example, most of the commands in the mysqlbin directory can be used to test the running status of the mysql process. If the command fails, an error will be returned. Mysqladmin, how to create

Use shell to write a script to monitor the running status of the mysql process and test whether mysql can be connected. If not, send an email and send an alarm. As for how to monitor, there are actually many commands. For example, most commands in the mysql/bin directory can be used to test the running status of the mysql process. If the command fails, an error will be returned. Mysqladmin, how to create

Use shell to write a script to monitor the running status of the mysql process and test whether mysql can be connected. If not, send an email to the police. As for how to monitor, there are actually many commands. For example, most commands in the mysql/bin directory can be used to test the running status of the mysql process. If the command fails, an error will be returned.

Mysqladmin: how to create a new table!

Used to perform administrative operations. Syntax:

Shell>; mysqladmin [OPTIONS] command [command-option] command...

Run mysqladmin -- help to obtain a list of options supported by your mysqladmin version.

Currently, mysqladmin supports the following commands:

Create databasename create a new database

Drop databasename delete a database and all its tables

Extended-status indicates an extended status message of the server.

Flush-hosts: cleans all cached hosts

Flush-logs clears all logs

Flush-tables: Remove all tables

Flush-privileges: Re-load the authorization table (same as reload)

Kill id, id,... kill mysql thread

Password: new password. Change the old password to a new password.

Ping to check if mysqld is alive

Processlist displays the list of active threads in the service.

Reload authorization table

Refresh cleans all tables and closes and opens log files.

Shutdown Server

Status indicates the brief status message of the server.

Variables: prints available variables.

Obtain the server version.

All commands can be shortened to their unique prefix. For example:

Shell>; mysqladmin proc stat
+ ---- + ------- + ----------- + ---- + ------------- + ------ + ------- + ------ +
| Id | User | Host | db | Command | Time | State | Info |
+ ---- + ------- + ----------- + ---- + ------------- + ------ + ------- + ------ +
| 6 | monty | localhost | Processlist | 0 |
+ ---- + ------- + ----------- + ---- + ------------- + ------ + ------- + ------ +
Uptime: 10077 Threads: 1 Questions: 9 Slow queries: 0 Opens: 6 Flush tables: 1
Open tables: 2 Memory in use: 1092 K Max memory used: 1116 K

The mysqladmin status command results in the following columns:

The number of seconds that the Uptime MySQL server has run

Number of Threads active Threads (customers)

Questions number of customer problems starting from mysqld

Slow queries has exceeded the number of queries in long_query_time seconds.

How many tables does Opens mysqld open?

Flush tables flush..., number of refresh and reload commands

Number of Open tables currently opened

Memory in use Memory directly allocated by mysqld code (available only when MySQL is compiled using -- with-debug)

Max memory used the maximum memory directly allocated by mysqld code (only available when MySQL is compiled using -- with-debug)

It is mainly used for management. If it is not used, go to mysql create table directly.

Or mysqldmin create database

./***. SQL (this is an exported or self-Written Statement)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.