⌘BABAKOV.NET Let's code!
100% [light] [ru]

Standard Utilities in MySQL

Standard utilities in MySQL are located in the bin subdirectory of the MySQL root directory.

The list of most frequently used utilities:

myisampack - Compresses tables of type MyISAM, reduces their size, and makes them read-only;

mysql - Console client for accessing the MySQL server, allows executing SQL queries and administering the server;

mysqladmin - Utility for performing administrative functions, such as creating or deleting databases, retrieving various information from the server, etc.;

mysqlbinlog - Used for reading the contents of the binary log for data recovery in emergency cases;

mysqlcheck - Used for describing, checking, optimizing, and recovering tables;

mysqldump - Outputs the contents of the MySQL database in the form of an SQL query file or a text file with tabs. Creates a dump of the specified databases.

mysqlhotcopy - Utility for creating a backup copy of tables without stopping the MySQL server, in other words, creating a hot copy of the database;

mysqlimport - Performs a transfer from a text file to database tables;

mysqlshow - Displays information about existing databases, tables, fields, and indexes.

Parameters used in MySQL utilities.
Most parameters have two forms (full and short). The full form of the parameter starts with two dashes, and the short form starts with one. Both forms can be used, but for some parameters, only the full form is available.

List of standard parameters that can be applied to all MySQL utilities:

--character-sets-dir=dir_name - Specifies the name of the directory dir_name, where character set files are stored;

--compress, -C - Parameter that activates data compression when exchanging data over the network between the client and server;

--default-character-set=charset - Sets the default character set charset;

--database=name, -D - Default database;

--delimiter=name - Default delimiter;

--vertical, -E - Output tables in vertical style;

--no-beep, -b - Do not produce a sound signal when an error occurs;

--help, -I, -? - Requires the program to display a help message and terminate;

--host=host_name, -h host_name - Specifies the network name or IP address of the host_name computer, where the MySQL server is installed;

--html, -H - Output query results in the form of an HTML table;

--xml, -X - Output query results in the form of an XML tree;

--password[=pas_val], -p[pas_val] - Specifies the password pas_val for accessing the MySQL server;

--port=port_name, -P port_name - Specifies the port number port_name, on which the MySQL server waits for a connection from the client (default 3306);

--user=user_name, -u user_name - Specifies the user name user_name, under which the connection to the MySQL server is made;

--version, -V - Outputs a string with information about the version and terminates.

Example: (making a dump of the database my_base)

mysqldump -u root my_base > my_base.sql

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.