CONTENT
  • CHANGES
Szukaj
counter

#top mysqladmin


mysqladmin - client for administering a MySQL server

Powiązane:
mysql, mysqladmin, mysqldump,

SYNOPSIS
mysqladmin [options] command [command-options] [command [command-options]] ...


DESCRIPTION



OPTIONS
--help, -?
Display a help message and exit.

--character-sets-dir=path
The directory where character sets are installed. See Section 8.1, "The Character Set Used for Data and Sorting".

--compress, -C
Compress all information sent between the client and the server if both support compression.

--count=N, -c N
The number of iterations to make for repeated command execution. This works only with the --sleep option.

--debug[=debug_options], -# [debug_options]
Write a debugging log. The debug_options string often is 'd:t:o,file_name'. The default is 'd:t:o,/tmp/mysqladmin.trace'.

--default-character-set=charset_name
Use charset_name as the default character set. See Section 8.1, "The Character Set Used for Data and Sorting".

--force, -f
Do not ask for confirmation for the drop db_name command. With multiple commands, continue even if an error occurs.

--host=host_name, -h host_name
Connect to the MySQL server on the given host.

--password[=password], -p[password]
The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.

Specifying a password on the command line should be considered insecure. See Section 6.6, “Keeping Your Password Secure”.

--port=port_num, -P port_num
The TCP/IP port number to use for the connection.

--protocol={TCP|SOCKET|PIPE|MEMORY}
The connection protocol to use.

--relative, -r
Show the difference between the current and previous values when used with the --sleep option. Currently, this option works only with the extended-status command.

--silent, -s
Exit silently if a connection to the server cannot be established.

--sleep=delay, -i delay
Execute commands repeatedly, sleeping for delay seconds in between. The --count option determines the number of iterations.

--socket=path, -S path
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.

--ssl*
Options that begin with --ssl specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates. See Section 6.7.3, “SSL Command Options”.

--user=user_name, -u user_name
The MySQL username to use when connecting to the server.

--verbose, -v
Verbose mode. Print more information about what the program does.

--version, -V
Display version information and exit.

--vertical, -E
Print output vertically. This is similar to --relative, but prints output vertically.

--wait[=count], -w[count]
If the connection cannot be established, wait and retry instead of aborting. If a count value is given, it indicates the number of times to retry. The default is one time.

You can also set the following variables by using --var_name=value syntax:

connect_timeout
The maximum number of seconds before connection timeout. The default value is 43200 (12 hours).

shutdown_timeout
The maximum number of seconds to wait for server shutdown. The default value is 3600 (1 hour).

It is also possible to set variables by using --set-variable=var_name=value or -O var_name=value syntax. This syntax is deprecated.



EXAMPLES
Set a new password. This changes the password to new-password for the account that you use with mysqladmin for connecting to the server. Thus, the next time you invoke mysqladmin (or any other client program) using the same account, you will need to specify the new password.
mysqladmin password new-password

mysqladmin -u root -p ping
mysqld is alive

Show a list of active server threads. This is like the output of the SHOW PROCESSLIST statement.
If the --verbose option is given, the output is like that of SHOW FULL PROCESSLIST.
(See Section 5.4.21, "SHOW PROCESSLIST Syntax".)
mysqladmin -u root -p processlist
+----+----------+-----------------+----------+---------+------+-------+------------------+
| Id | User     | Host            | db       | Command | Time | State | Info             |
+----+----------+-----------------+----------+---------+------+-------+------------------+
| 1  | root     | localhost       |          | Query   | 0    |       | show processlist |
+----+----------+-----------------+----------+---------+------+-------+------------------+

Reload the grant tables.
mysqladmin -u root -p reload

Flush all tables and close and open log files.
mysqladmin -u root -p refresh

Stop the server.
mysqladmin -u root -p shutdown

Start replication on a slave server.
mysqladmin -u root -p start-slave

Display a short server status message.
mysqladmin -u root -p status

Stop replication on a slave server.
mysqladmin -u root -p stop-slave

Display the server system variables and their values.
mysqladmin -u root -p variables

Display version information from the server.
mysqladmin -u root -p version

mysqladmin -u root -p proc stat
mysqladmin -u root -p process stat
+----+----------+-----------------+----------+---------+------+-------+------------------+
| Id | User     | Host            | db       | Command | Time | State | Info             |
+----+----------+-----------------+----------+---------+------+-------+------------------+
| 1  | root     | localhost       |          | Query   | 0    |       | show processlist |
+----+----------+-----------------+----------+---------+------+-------+------------------+
Uptime: 6481  Threads: 1  Questions: 837828  Slow queries: 2  Opens: 16  Flush tables: 1  Open tables: 10  Queries per second avg: 129.274

Create a new database named db_name.
mysqladmin -u root -p create db_name

Delete the database named db_name and all its tables.
mysqladmin -u root -p drop db_name

Display the server status variables and their values.
mysqladmin -u root -p extended-status
+-----------------------------------+-----------+
| Variable_name                     | Value     |
+-----------------------------------+-----------+
[...]
| Bytes_received                    | 191328581 |
| Bytes_sent                        | 9307919   |
[...]
| Open_files                        | 20        |
| Open_streams                      | 0         |
| Open_tables                       | 10        |
| Opened_tables                     | 16        |
[...]
| Questions                         | 838915    |
| Threads_cached                    | 0         |
| Threads_connected                 | 4         |
| Threads_created                   | 4         |
| Threads_running                   | 1         |
| Uptime                            | 6604      |
| Uptime_since_flush_status         | 6604      |
+-----------------------------------+-----------+

Flush all information in the host cache.
mysqladmin -u root -p flush-hosts

Flush all logs.
mysqladmin -u root -p flush-logs

Reload the grant tables (same as reload).
mysqladmin -u root -p flush-privileges

Clear status variables.
mysqladmin -u root -p flush-status

Flush all tables.
mysqladmin -u root -p flush-tables

Flush the thread cache.
mysqladmin -u root -p flush-threads

Kill server threads. If multiple thread ID values are given, there must be no spaces in the list.
mysqladmin -u root -p kill id,id,..




Zmodyfikowany ostatnio: 2014/05/15 09:59:25 (9 lat temu), textsize: 9,20 kB, htmlsize: 11,4 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników