Starting MySQL

Revision as of 10:25, 19 July 2012 by Connor (talk | contribs) (Created page with "<h1>Running MySQL</h1> <table border="1"> <tr> <th>Name of the server</th> <td>mysqld or mysqld.exe</td> </tr> <tr> <th>Name of the client</th> <td>mysql or mysql.exe</td> </...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Running MySQL

Name of the server mysqld or mysqld.exe
Name of the client mysql or mysql.exe
Typical command line to start the client c:\mysql\bin\mysql -h -u scott -p gisq

the internet address of a computer running the server


the user name


the name of the database to use


forces a prompt for password

Useful commands
show tables;
describe tableX;
use databaseY;
source file.txt
Beware! Foreign keys are not enforced. Table names are case sensitive when running on Unix

The MySQL client is called mysql.

C:\>c:\mysql\bin\mysql -h -u scott -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 33601 to server version: 3.23.43-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

use gisq
Database changed
mysql>SELECT name FROM cia;
| Western Sahara                               |
| Yemen                                        |
| Zambia                                       |
| Zimbabwe                                     |
261 rows in set (0.01 sec)

Some useful commands in MySQL:

  • show tables;
  • describe cia;