"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

Last updated Friday October 27, 2006


Printer-friendly PDF* format:

How To Guides for MySQL

This Section

You are currently viewing this page in XHTML 1 Style Sheet* format (* see Clicklets for more infomation). This document is also available in XHTML 1*XML*HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.