Exploring the database

Sign into your development environment with SSH.

Signing into MySQL
You can find the log in credentials you need in the :

Replace the items in brackets with the values assigned above:

mysql -u -p

For example:

mysql -u dh_foxfirefey -p dreamhack_foxfirefey

And enter the password when prompted. You will then see information like this before it gives you a prompt:

Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12284107 Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)

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

The emphasized portion lets you know what version of MySQL you are using, in case you have to look things up in the MySQL documentation.

Show all tables
Data in the database is stored in a collection of tables, each of which is like a spreadsheet with rows containing a certain amount of columns. To present a list of all the tables in the database, use this command:

mysql> SHOW TABLES;

Show all columns in a table
This command will show you a list of all of the columns in a table, which is all of the pieces of data a row has.

mysql> SHOW COLUMNS FROM  here means that is the tables primary key. means that bit of data will be unique for that row--that is, if one row has "moo", another row cannot have the value "moo" in that table.
 * Default -- the default value for the column, if none is specified
 * Extra -- if  is here, that means that every new row to that table automatically gets a higher value than the last row added.