SQL

mysql Command Options

The following are options you can use when calling the mysql command:
–auto-rehash Enable or disable automatic rehashing
–auto-vertical-output Automatically display output of commands vertically rather than horizontally
–batch Do not write to the history file
–binary I use this when I have large results timing out due to blobs being in there
–bind-address Specify a network interface when connecting to the server
–character-sets-dir Indicate a custom directory where character sets are installed
–column-names Output column names when running queries
–column-type-info Show metadata
–comments Enable or disable commenting when sending statements to the server
–compress Compresses data sent to/from client and server
–connect_timeout Seconds of inactivity before a timeout
–database Defines the database you are connecting to
–debug Writes a debugging log
–debug-check Shows debugging information
–debug-info Shows memory and CPU information
–default-auth Authentication plugin to use
–default-character-set Default character set
–defaults-extra-file Read in options from a second config file
–defaults-file Read in options from a single config file
–delimiter Define a delimiter
–enable-cleartext-plugin Allow cleartext authentication
–execute Run a given statement and then stop mysql
–force Keep going, even in the event of an error
–help Show help information
–histignore Define some statements that will not get logged
–host Define a MySQL server to connect to
–html Show results in HTML
–ignore-spaces Ignore spaces after functions
–init-command Run listed statements when running a command
–line-numbers Use line numbers with errors
–login-path Use any login path options defined in a .cnf file
–max_allowed_packet Maximum packet length to use with a server
–max_join_size Limit joins with –safe-updates
–named-commands Allow named mysql commands
–net_buffer_length Buffer TCP/IP sockets
–no-auto-rehash Turn automatic rehashing off
–no-beep Don’t beep on errors
–no-defaults Don’t use any config files when loading
–one-database Only allow statements run on the specified database
–pager Show output for a statement one page at a time
–password The password to use when connecting to a server
–pipe Connect to servers via named pipes (any time you see named pipes it means Windows)
–plugin-dir Location (URI) of plugin files
–port TCP/IP port number
–print-defaults Show defaults
–prompt Prompt for a format
–protocol Defines the protocol to use to connect to the server
–quick Don’t cache every statement
–raw Show columns without escaping
–reconnect Reconnect if a connection is lost
–safe-updates Only process UPDATE and DELETE statements when they have values
–secure-auth Send passwords securely
–select_limit The limit for SELECT statements with –safe-updates
–server-public-key-path Path to a file with a public key
–shared-memory-base-name The name used for shared-memory connections
–show-warnings Display warnings per statement
–sigint-ignore Don’t allow SIGINT signals to stop the daemon
–silent Run silently (necessary when daemonizing)
–skip-auto-rehash Turn off automated rehashing
–skip-column-names Don’t use column names as headers
–skip-line-numbers Don’t use line numbers on errors
–skip-named-commands Turns off named commands
–skip-pager Turn off paging
–skip-reconnect Don’t reconnect
–socket Define a socket file for localhost connections
–ssl Enable SSL
–ssl-ca File with a list of trusted CAs
–ssl-capath Directory with trusted CA certificates in PEM
–ssl-cert Directory with X509 certificates in PEM
–ssl-cipher Allowed ciphers
–ssl-crl File used to define CRLs (certificate revocation lists)
–ssl-crlpath Path of directory that contains certificate revocation list files
–ssl-key Path to file with an X509 key formatted as PEM
–ssl-mode Display the security mode on a connection to a server
–ssl-verify-server-cert Verify Common Name (CN) and actual hostname when establishing a connection
–syslog Logs out to syslog
–table Tabular (and maybe tubular while we’re at it) format
–tee Output to a file
–tls-version Protocols used to secure connections
–unbuffered Constantly flush buffers
–user The user name to use when connecting to server (SQL users are not the same as users on an OS)
–verbose As with most other commands, output verbosely
–version Show the MySQL version number
–vertical Show one line per column in query outputs
–wait Retry when a connection fails
–xml Output data into an XML format