Full MySQL command line parameters

Source: Internet
Author: User
Tags mysql tutorial rehash sql error

Full MySQL command line parameters

The mysql tutorial supports the following options:


--- Help ,-?
Displays the help message and exits.


-- Batch,-B
Print the result and use tab as the column delimiter. Each row occupies a new row. With this option, mysql does not use history files.


-- Character-sets-dir = path
Character Set installation directory.


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


--- Database = db_name,-D db_name
The database tutorial to use. It is mainly useful in option files.


--- Debug [= debug_options],-# [debug_options]
Write debugging logs. The debug_options string is usually 'd: t: o, file_name '. The default value is d: t: o,/tmp/mysql. trace '.


--- Debug-info,-T
Some debugging information is output when the program exits.


-- Default-character-set = charset
Use charsetas as the default character set.


-- Execute = statement,-e statement
Execute the statement and exit. The default output format is the same as that produced by -- batch.


-- Force,-f
Continue even if an SQL error occurs.


-- Host = host_name,-h host_name
Connect the MySQL server on the specified host.


-- Html,-H
Generate HTML output.


-- Ignore-space,-I
Ignore the space behind the function name


-- Local-infile [= {0 | 1}]
Enable or disable the LOCAL function for load data infile. No value. This option enables LOCAL. You can also use -- local-infile = 0 or -- local-infile = 1 to explicitly disable or enable LOCAL. If not supported by the server, enabling LOCAL does not take effect.


-- Named-commands,-G
The naming command is enabled. Allow long-Format Commands and Short-format * commands. For example, both quit and q are identified.


-- No-auto-rehash,-
The hash operation is not automatically performed. This option enables mysql to start faster, but if you want to complete the table and column name, you must issue the rehash command.


-- No-beep,-B
Do not send an alarm when an error occurs.


-- No-named-commands,-g
The named command is disabled. Use only the * format, or use only the name starting with the line to end with a semicolon. For MySQL 3.23.22, this option is enabled when mysql is started by default. However, even if this option is used, long-Format Commands still work from 1st lines.


-- No-pager
No page splitter is used to display query output.


-- No-tee
Do not copy the output to the file.
·
-- One -- database,-O
Ignore statements except for the default database named in the command line. This helps to skip updates to other databases in binary logs.

 

-- Pager [= command]
Use the given command to query the output by page. If this command is deleted, the default page splitter is the value of the PAGER environment variable. Valid pagers include less, more, cat [> filename], and so on. This option only works in Unix. Cannot work in batch mode


-- Password [= password],-p [password]
The password used to connect to the server. If you use the short option format (-p), there must be no space between the option and password. If there is no password value after the -- password or-p option in the command line, a prompt is displayed for entering a password. The password should be omitted in SysV-based UNIX systems because it can be displayed in the output of the PS tutorial.


-- Port = port_num,-P port_num
The TCP/IP Port used for connection.


-- Prompt = format_str
Set the prompt to the specified format. The default value is mysql>.


-- Protocol = {TCP | SOCKET | PIPE | MEMORY}
The connection protocol used.


-- Quick,-q
The results of each query are not cached and each row is printed in the receiving order. If the output is suspended, the server slows down. With this option, mysql does not use history files.


-- Raw,-r
Write column values without escape conversion. It is usually used in combination with the -- batch option.


-- Reconnect
If the connection is disconnected from the server, the system automatically tries to reconnect. Try again after each disconnection. To disable reconnection, use -- skip-reconnect.


-- Safe-updates, -- I-am-a-dummy,-U
Only the UPDATE and DELETE statements that take effect for the specified row with the key value are allowed. If you have set this option in the option file, you can overwrite it with -- safe-updates in the command line.


-- Secure-auth
Do not send a password to an old (pre-4.1.1) format server. This prevents connection to servers that do not use the new password format.


-- Show-warnings
If each statement has a warning, it is displayed. This option applies to interactive and batch processing modes.


-- Sigint-ignore
Ignore the SIGINT sign (generally the result of Control-C ).


-- Silent,-s
Silence mode. Produce less output. You can use this option multiple times to produce less output.


-- Skip-column-names,-N
Do not write column names in the results.


-- Skip-line-numbers,-L
No row number is specified in the error message. It is useful when you want to compare result files that contain error messages.


-- Socket = path,-S path
The socket file used for connection.


-- Tables,-t
Display the output in a table. This is the default setting for interactive applications, but can be used to generate table output in batch mode.


-- Tee = file_name
Add the output copy to the specified file. This option does not work in batch processing mode.


-- Unbuffered,-n
Refresh the cache area after each query.


-- User = user_name,-u user_name
The username used by MySQL to connect to the server.


-- Verbose,-v
Lengthy mode. Generate more output. You can use this option multiple times to produce more output. (For example,-v can even generate the table output format in batch processing mode ).

 

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


-- Vertical,-E
Vertical output query output rows. Without this option, you can end with G to specify the vertical output of a single statement.


-- Wait,-w
If a connection cannot be established, wait and try again instead of giving up.


-- Xml,-X
Generate XML output.
You can also use the -- var_name = value option to set the following variables:


Connect_timeout
The number of seconds before the connection times out. (The default value is 0 ).

 

Max_allowed_packet
Maximum length of packets sent or received from the server. (The default value is 16 MB ).

 

Max_join_size
Automatic limits on the rows that are joined when -- safe-updates is used. (The default value is 1,000,000 ).

 

Net_buffer_length
The size of the TCP/IP and socket communication buffer. (The default value is 16 KB ).

 

Select_limit
The automatic limit of the SELECT statement when -- safe-updates is used. (The default value is 1,000 ).
You can also use the -- set-variable = var_name = value or-O var_name = value Syntax to set the variable. [I] This syntax [/I] is not supported.

Related Article

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.