| 1 |
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. |
| 2 |
|
| 3 |
Usage: /usr/bin/mariadb [OPTIONS] [database] |
| 4 |
|
| 5 |
Default options are read from the following files in the given order: |
| 6 |
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf |
| 7 |
The following groups are read: mysql mariadb-client client client-server client-mariadb |
| 8 |
The following options may be given as the first argument: |
| 9 |
--print-defaults Print the program argument list and exit. |
| 10 |
--no-defaults Don't read default options from any option file. |
| 11 |
The following specify which files/extra groups are read (specified before remaining options): |
| 12 |
--defaults-file=# Only read default options from the given file #. |
| 13 |
--defaults-extra-file=# Read this file after the global files are read. |
| 14 |
--defaults-group-suffix=# Additionally read default groups with # appended as a suffix. |
| 15 |
|
| 16 |
-?, --help Display this help and exit. |
| 17 |
-I, --help Synonym for -? |
| 18 |
--abort-source-on-error |
| 19 |
Abort 'source filename' operations in case of errors |
| 20 |
--auto-rehash Enable automatic rehashing. One doesn't need to use |
| 21 |
'rehash' to get table and field completion, but startup |
| 22 |
and reconnecting may take a longer time. |
| 23 |
(Defaults to on; use --skip-auto-rehash to disable.) |
| 24 |
-A, --no-auto-rehash |
| 25 |
No automatic rehashing. One has to use 'rehash' to get |
| 26 |
table and field completion. This gives a quicker start of |
| 27 |
mysql and disables rehashing on reconnect. |
| 28 |
--auto-vertical-output |
| 29 |
Automatically switch to vertical output mode if the |
| 30 |
result is wider than the terminal width. |
| 31 |
-B, --batch Don't use history file. Disable interactive behavior. |
| 32 |
(Enables --silent.) |
| 33 |
--binary-as-hex Print binary data as hex |
| 34 |
--binary-mode Binary mode allows certain character sequences to be |
| 35 |
processed as data that would otherwise be treated with a |
| 36 |
special meaning by the parser. Specifically, this switch |
| 37 |
turns off parsing of all client commands except \C and |
| 38 |
DELIMITER in non-interactive mode (i.e., when binary mode |
| 39 |
is combined with either 1) piped input, 2) the --batch |
| 40 |
mysql option, or 3) the 'source' command). Also, in |
| 41 |
binary mode, occurrences of '\r\n' and ASCII '\0' are |
| 42 |
preserved within strings, whereas by default, '\r\n' is |
| 43 |
translated to '\n' and '\0' is disallowed in user input. |
| 44 |
--character-sets-dir=name |
| 45 |
Directory for character set files. |
| 46 |
--column-names Write column names in results. |
| 47 |
(Defaults to on; use --skip-column-names to disable.) |
| 48 |
-N, --skip-column-names |
| 49 |
Don't write column names in results. |
| 50 |
--column-type-info Display column type information. |
| 51 |
-c, --comments Preserve comments. Send comments to the server. The |
| 52 |
default is --skip-comments (discard comments), enable |
| 53 |
with --comments. |
| 54 |
-C, --compress Use compression in server/client protocol. |
| 55 |
--connect-expired-password |
| 56 |
Notify the server that this client is prepared to handle |
| 57 |
expired password sandbox mode even if --batch was |
| 58 |
specified. |
| 59 |
--connect-timeout=# Number of seconds before connection timeout. |
| 60 |
-D, --database=name Database to use. |
| 61 |
-#, --debug[=#] This is a non-debug version. Catch this and exit. |
| 62 |
--debug-check Check memory and open file usage at exit. |
| 63 |
-T, --debug-info Print some debug info at exit. |
| 64 |
--default-auth=name Default authentication client-side plugin to use. |
| 65 |
--default-character-set=name |
| 66 |
Set the default character set. |
| 67 |
--delimiter=name Delimiter to be used. |
| 68 |
--enable-cleartext-plugin |
| 69 |
Obsolete option. Exists only for MySQL compatibility. |
| 70 |
-e, --execute=name Execute command and quit. (Disables --force and history |
| 71 |
file.) |
| 72 |
-f, --force Continue even if we get an SQL error. Sets |
| 73 |
abort-source-on-error to 0 |
| 74 |
-h, --host=name Connect to host. Defaults in the following order: |
| 75 |
$MARIADB_HOST, $MYSQL_HOST, and then localhost |
| 76 |
-H, --html Produce HTML output. |
| 77 |
-i, --ignore-spaces Ignore space after function names. |
| 78 |
--init-command=name SQL Command to execute when connecting to MariaDB server. |
| 79 |
Will automatically be re-executed when reconnecting. |
| 80 |
--line-numbers Write line numbers for errors. |
| 81 |
(Defaults to on; use --skip-line-numbers to disable.) |
| 82 |
-L, --skip-line-numbers |
| 83 |
Don't write line number for errors. |
| 84 |
--local-infile Enable LOAD DATA LOCAL INFILE. |
| 85 |
--max-allowed-packet=# |
| 86 |
The maximum packet length to send to or receive from |
| 87 |
server. |
| 88 |
--max-join-size=# Automatic limit for rows in a join when using |
| 89 |
--safe-updates. |
| 90 |
-G, --named-commands |
| 91 |
Enable named commands. Named commands mean this program's |
| 92 |
internal commands; see mysql> help . When enabled, the |
| 93 |
named commands can be used from any line of the query, |
| 94 |
otherwise only from the first line, before an enter. |
| 95 |
Disable with --disable-named-commands. This option is |
| 96 |
disabled by default. |
| 97 |
--net-buffer-length=# |
| 98 |
The buffer size for TCP/IP and socket communication. |
| 99 |
-b, --no-beep Turn off beep on error. |
| 100 |
-o, --one-database Ignore statements except those that occur while the |
| 101 |
default database is the one named at the command line. |
| 102 |
--pager[=name] Pager to use to display results. If you don't supply an |
| 103 |
option, the default pager is taken from your ENV variable |
| 104 |
PAGER. Valid pagers are less, more, cat [> filename], |
| 105 |
etc. See interactive help (\h) also. This option does not |
| 106 |
work in batch mode. Disable with --disable-pager. This |
| 107 |
option is disabled by default. |
| 108 |
-p, --password[=name] |
| 109 |
Password to use when connecting to server. If password is |
| 110 |
not given it's asked from the tty. |
| 111 |
--plugin-dir=name Directory for client-side plugins. |
| 112 |
-P, --port=# Port number to use for connection or 0 for default to, in |
| 113 |
order of preference, my.cnf, $MYSQL_TCP_PORT, |
| 114 |
/etc/services, built-in default (3306). |
| 115 |
--print-query-on-error |
| 116 |
Print the query if there was an error. Is only enabled in |
| 117 |
--batch mode if verbose is not set (as then the query |
| 118 |
would be printed anyway) |
| 119 |
(Defaults to on; use --skip-print-query-on-error to disable.) |
| 120 |
--progress-reports Get progress reports for long running commands (like |
| 121 |
ALTER TABLE) |
| 122 |
(Defaults to on; use --skip-progress-reports to disable.) |
| 123 |
--prompt=name Set the command line prompt to this value. |
| 124 |
--protocol=name The protocol to use for connection (tcp, socket, pipe). |
| 125 |
-q, --quick Don't cache result, print it row by row. This may slow |
| 126 |
down the server if the output is suspended. Doesn't use |
| 127 |
history file. |
| 128 |
--quick-max-column-width=# |
| 129 |
Maximum number of characters displayed in a column header |
| 130 |
when using --quick |
| 131 |
-r, --raw Write fields without conversion. Used with --batch. |
| 132 |
--reconnect Reconnect if the connection is lost. |
| 133 |
(Defaults to on; use --skip-reconnect to disable.) |
| 134 |
-U, --safe-updates Only allow UPDATE and DELETE that uses keys. |
| 135 |
-U, --i-am-a-dummy Synonym for option --safe-updates, -U. |
| 136 |
--sandbox Disallow commands that access the file system (except \P |
| 137 |
without an argument and \e). |
| 138 |
--secure-auth Refuse client connecting to server if it uses old |
| 139 |
(pre-4.1.1) protocol. |
| 140 |
--select-limit=# Automatic limit for SELECT when using --safe-updates. |
| 141 |
--server-arg=name Send embedded server this as a parameter. |
| 142 |
--show-query-costs Show query cost after every statement. |
| 143 |
--show-warnings Show warnings after every statement. |
| 144 |
--sigint-ignore Ignore SIGINT (CTRL-C). |
| 145 |
-s, --silent Be more silent. Print results with a tab as separator, |
| 146 |
each row on new line. |
| 147 |
-S, --socket=name The socket file to use for connection. |
| 148 |
--ssl Enable SSL for connection (automatically enabled with |
| 149 |
other flags). |
| 150 |
(Defaults to on; use --skip-ssl to disable.) |
| 151 |
--ssl-ca=name CA file in PEM format (check OpenSSL docs, implies |
| 152 |
--ssl). |
| 153 |
--ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). |
| 154 |
--ssl-cert=name X509 cert in PEM format (implies --ssl). |
| 155 |
--ssl-cipher=name SSL cipher to use (implies --ssl). |
| 156 |
--ssl-key=name X509 key in PEM format (implies --ssl). |
| 157 |
--ssl-crl=name Certificate revocation list (implies --ssl). |
| 158 |
--ssl-crlpath=name Certificate revocation list path (implies --ssl). |
| 159 |
--tls-version=name TLS protocol version for secure connection. |
| 160 |
--ssl-fp=name Server certificate fingerprint (implies --ssl). |
| 161 |
--ssl-fplist=name File with accepted server certificate fingerprints, one |
| 162 |
per line (implies --ssl). |
| 163 |
--ssl-verify-server-cert |
| 164 |
Verify server's certificate to prevent man-in-the-middle |
| 165 |
attacks |
| 166 |
(Defaults to on; use --skip-ssl-verify-server-cert to disable.) |
| 167 |
-t, --table Output in table format. |
| 168 |
--tee=name Append everything into outfile. See interactive help (\h) |
| 169 |
also. Does not work in batch mode. Disable with |
| 170 |
--disable-tee. This option is disabled by default. |
| 171 |
-n, --unbuffered Flush buffer after each query. |
| 172 |
-u, --user=name User for login if not current user. |
| 173 |
-v, --verbose Write more. (-v -v -v gives the table output format). |
| 174 |
-V, --version Output version information and exit. |
| 175 |
-E, --vertical Print the output of a query (rows) vertically. |
| 176 |
-w, --wait Wait and retry if connection is down. |
| 177 |
-X, --xml Produce XML output. |
| 178 |
|
| 179 |
Variables (--variable-name=value) |
| 180 |
and boolean options {FALSE|TRUE} Value (after reading options) |
| 181 |
--------------------------------- ---------------------------------------- |
| 182 |
abort-source-on-error FALSE |
| 183 |
auto-rehash TRUE |
| 184 |
auto-vertical-output FALSE |
| 185 |
binary-as-hex FALSE |
| 186 |
binary-mode FALSE |
| 187 |
character-sets-dir (No default value) |
| 188 |
column-names TRUE |
| 189 |
column-type-info FALSE |
| 190 |
comments FALSE |
| 191 |
compress FALSE |
| 192 |
connect-expired-password FALSE |
| 193 |
connect-timeout 0 |
| 194 |
database (No default value) |
| 195 |
debug-check FALSE |
| 196 |
debug-info FALSE |
| 197 |
default-auth (No default value) |
| 198 |
default-character-set auto |
| 199 |
delimiter ; |
| 200 |
force FALSE |
| 201 |
host (No default value) |
| 202 |
html FALSE |
| 203 |
ignore-spaces FALSE |
| 204 |
init-command (No default value) |
| 205 |
line-numbers TRUE |
| 206 |
local-infile FALSE |
| 207 |
max-allowed-packet 16777216 |
| 208 |
max-join-size 1000000 |
| 209 |
named-commands FALSE |
| 210 |
net-buffer-length 16384 |
| 211 |
no-beep FALSE |
| 212 |
plugin-dir (No default value) |
| 213 |
port 0 |
| 214 |
print-query-on-error TRUE |
| 215 |
progress-reports TRUE |
| 216 |
prompt \N [\d]> |
| 217 |
protocol |
| 218 |
quick FALSE |
| 219 |
quick-max-column-width 9223372036854775807 |
| 220 |
raw FALSE |
| 221 |
reconnect TRUE |
| 222 |
safe-updates FALSE |
| 223 |
i-am-a-dummy FALSE |
| 224 |
sandbox FALSE |
| 225 |
secure-auth FALSE |
| 226 |
select-limit 1000 |
| 227 |
show-query-costs FALSE |
| 228 |
show-warnings FALSE |
| 229 |
sigint-ignore FALSE |
| 230 |
socket /run/mysqld/mysqld.sock |
| 231 |
ssl TRUE |
| 232 |
ssl-ca (No default value) |
| 233 |
ssl-capath (No default value) |
| 234 |
ssl-cert (No default value) |
| 235 |
ssl-cipher (No default value) |
| 236 |
ssl-key (No default value) |
| 237 |
ssl-crl (No default value) |
| 238 |
ssl-crlpath (No default value) |
| 239 |
tls-version (No default value) |
| 240 |
ssl-fp (No default value) |
| 241 |
ssl-fplist (No default value) |
| 242 |
ssl-verify-server-cert TRUE |
| 243 |
table FALSE |
| 244 |
unbuffered FALSE |
| 245 |
user (No default value) |
| 246 |
vertical FALSE |
| 247 |
xml FALSE |