MySQL
Common MySQL Syntax | Common MySQL Syntax |
|
If you want to find out which options will be taken from option files by mysql, use this command: % mysql --print-defaults You can also use the my_print_defaults utility, which takes as arguments the names of the option file groups that it should read. For example, mysql looks in both the [client] and [mysql] groups for options, so you can check which values it will take from option files like this: % my_print_defaults client mysql If you need to connect on occasion as the MySQL root user, specify the user and password options on the command line to override the option file values: % mysql -p -u root To issue a query at the mysql> prompt, type it in, add a semicolon ( ;) at the end to signify the end of the statement, and press Return. Examples mysql> SELECT NOW( ); +---------------------+ mysql> SELECT The STATUS command (and its synonym, \s) also display the current database name, in additional to several other pieces of information: mysql> \s -------------- To cancel the statement completely, enter \c and type Return. This will return you to the mysql> prompt: mysql> SELECT * |
