MySQL Quick Reference

[Pages:1]MySQL Quick Reference

The complete manual for MySQL is located at .

Names quoted inside "" symbols should be replaced with what they describe.

? Connecting: o shell> mysql -h host -u user ?p

? Disconnecting: o mysql> QUIT or CTRL-D

? Show all databases: o mysql> SHOW DATABASES;

? Switch to an existing database: o mysql> USE

? Grant permission to a database to a single user: o mysql> GRANT ALL ON .* TO ;

? Create a database: o mysql> CREATE DATABASE ;

? Display tables in the current database: o mysql> SHOW TABLES;

? View a table's structure: o mysql>DESCRIBE ;

? Adding information (strings and dates need to have single quotes around the : o mysql> INSERT INTO VALUES (, ... , );

? Adding information from a file (one record per line, values separated by tabs): o mysql> LOAD DATA LOCAL INFILE "" INTO TABLE ;

? Retrieving information: o mysql>SELECT FROM WHERE

? Deleting all information in a table: o mysql> DELETE FROM ;

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download