6.470 Day 2 |
Setting Up Your Database |
<username>+<database name>
. Note that
you are limited to 5 databases and 100 MB of data. If you find
yourself running out of room, contact the 6.470 staff so we can
work something out.
You have at least two choices for interacting with your database:
To get yourself to a mysql prompt, do one of the following:
add mysql
to add the mysql locker so you can use the mysql softwaremysql -h sql.mit.edu -u <username> -p
Applications > Utilities
, and on
Windows you may have to download an SSH client
like Putty.
linerva.mit.edu
, which is a public Linux dialup maintained by SIPB. From a terminal enter:ssh <username>@linerva.mit.edu
linerva.mit.edu
as the remote host.
Once you're at the mysql prompt you need to switch to the database that you are using:
mysql> use <username>+<database name>
You're now read to manipulate your database.
mysql> show tables;
will give you a list of the tables in this databsemysql> desc <tablename> will give the schema for a particular table
CREATE TABLE
, ALTER TABLE
, and DELETE TABLE
mysql> SELECT * FROM <tablename> LIMIT 10
is a quick way to see and sanity check some of the rows in a tablemysql> SELECT COUNT(*) FROM <tablename>
is a quick way to get the number of rows in a table