mysql Command-Line Tool
(Redirected from mysql)
Jump to navigation
Jump to search
A mysql Command-Line Tool is a SQL command-line shell to access a MySQL server instance.
- Example(s):
mysql -u root -p
- See: MySQL, mysqlcheck.
References
2015
- http://dev.mysql.com/doc/refman/5.7/en/mysql.html
- QUOTE: mysql is a simple SQL shell with input line editing capabilities. It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options.
shell> mysql db_name
Or:shell> mysql --user=user_name --password=your_password db_name
Then type an SQL statement, end it with “;”, \g, or \G and press Enter.
Typing Control+C interrupts the current statement if there is one, or cancels any partial input line otherwise.
You can execute SQL statements in a script file (batch file) like this:
shell> mysql db_name < script.sql > output.tab
On Unix, the mysql client logs statements executed interactively to a history file. See Section 4.5.1.3, “mysql Logging”.
- QUOTE: mysql is a simple SQL shell with input line editing capabilities. It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options.