"How To" Guides for MySQL

Show available commands

mysql> help
-> \?

Access a specified database

mysql> use dbname
-> \u dbname

Clear SQL buffer

mysql> clear
-> \c

Edit SQL in buffer

mysql> edit
-> \e

Execute SQL buffer

mysql> go
-> \g

Start and stop logging to an output file

A copy of all screen activity will be written to the specified file, appending to the file if the output file already exists.

mysql> tee filepath
-> \T filepath
mysql> notee
-> \t

Execute an SQL script

mysql> source filepath
-> \. filepath

Execute an operating system command

mysql> system command
-> \! command

Exit MySQL client and return to operating system

mysql> exit
mysql> quit
-> \q

 

Home > Computers > Databases > MySQL > Commands

Viewing mobile website page. Switch to WML or Full HTML