Verify server's "Common Name" in its cert against ssl-key=name X509 key in PEM format (implies -ssl). ssl-cipher=name SSL cipher to use (implies -ssl). ssl-cert=name X509 cert in PEM format (implies -ssl). ssl-capath=name CA directory (check OpenSSL docs, implies -ssl). ssl-ca=name CA file in PEM format (check OpenSSL docs, implies ssl Enable SSL for connection (automatically enabled with S, -socket=name Socket file to use for connection. reconnect Reconnect if the connection is lost. r, -raw Write fields without conversion. This may slowĭown the server if the output is suspended. q, -quick Don't cache result, print it row by row. protocol=name The protocol of connection (tcp,socket,pipe,memory). prompt=name Set the mysql prompt to this value. P, -port=# Port number to use for connection. Password to use when connecting to server. no-pager Disable pager and print to stdout. Option the default pager is taken from your ENV variable Skipping updates to other database in the update log. o, -one-database Only update the default database. Option is deprecated you can set variables directly with WARNING: -N isĭeprecated, use long version of this options instead.Ĭhange the value of a variable. column-names Write column names in results.ĭon't write column names in results. n, -unbuffered Flush buffer after each query. WARNING: -L isĭeprecated, use long version of this option instead. line-numbers Write line numbers for errors.ĭon't write line number for errors. local-infile Enable/disable LOAD DATA LOCAL INFILE. i, -ignore-spaces Ignore space after function names. Long format commands still work from the first Starts with this option ENABLED by default! Disable with With a semicolon ( ) Since version 10.9 the client now Named commands only in the beginning of a line ending Otherwise only from the first line, before an enter.ĭisable with -disable-named-commands. Named commands can be used from any line of the query, f, -force Continue even if we get an sql error.Įnable named commands. E, -vertical Print the output of a query (rows) vertically. e, -execute=name Execute command and quit. C, -compress Use compression in server/client protocol. Options deprecated use -disable-auto-rehash instead. Mysql and disables rehashing on reconnect. 'rehash' to get table and field completion, but startupĪnd reconnecting may take a longer time. The mysql tool supports the following command-line options: To exit from mysql type quit at the mysql> command-prompt. If a command is not terminated by a semi-colon, pressing enter simply continues the current command on the following line. Typing help at this prompt will display a list of the commands supported by the tool (listed below).Ĭommands are terminated by a semi-colon ( ). Once mysql is running, commands are entered at the mysql> prompt. If the mysql client is running a different system to the MySQL server, the -h flag may be used to specify the name of the remote host together with -P to specify the port: mysql -h myDBServer -p 5678Ī list of command-line options can be obtained running mysql -help at the command-prompt (listed below). The above command will prompt for the password for user john before allowing access to the database management system. For example, if your database server requires a username and password to gain access the -u and -p command-line options may be used respectively: mysql -u john -p If you see an error message, it may be that your database system is configured to require login credentials, or that the server is running on a different system. Your MySQL connection id is 234343 to server version: 5.0.27 The above command will display the following output: Welcome to the MySQL monitor. Throughout this book the capabilities of the mysql tool will be covered in great detail.Īssuming MySQL has been installed the mysql tool may be loaded at the operating system command-prompt as follows: mysql From the mysql command-prompt it is possible to issue a wide range of commands to the database server such as creating and deleting databases and tables, searching for data, adding new rows and much more. mysql is a command-line client tool that is installed as standard with the MySQL package. The mysql tool is probably the most useful utility and is the tool that you will likely use the most as you learn and continue to use MySQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |