MySQL Database management system available under GPL http://dev.mysql.com/downloads/mysql/5.0.html Abundant documentation available for MySQL http://dev.mysql.com/doc/ http://dev.mysql.com/doc/refman/5.0/en/index.html (very useful!) Setting up MySQL on a Windows platform: http://www.cs.jhu.edu/~yarowsky/MySQL/MySQL_startup.pdf For linux, download rpm's/necessary packages from the MySQL site and setup. All the above for setting up MySQL on your personal computers But you can access dbase.cs.jhu.edu which has MySQL installed and administered! http://www.cs.jhu.edu/~yarowsky/MySQL/dbase_MySQL.pdf Login to dbase with your ugrad account usernames To use the MySQL databases there, use your assigned MySQL usernames and passwords, Will be sent in an e-mail to you. =========================== To run MySQL: > mysql -u user_name -p the -u option is to specify the MySQL username (assigned to you) the -p option prompts for the password Once in, some commonly used commands: show databases; (shows a list of all the databases) use database_name; (access the tables in the database: database_name) show tables; (shows a list of the tables in the current database) desc table_name; (shows how the particular table has been defined) At any point you can shift to a different database to see the data in it. But tables in the database can only be accessed when you are 'use'ing that DB. quit; (to quit MySQL) Note:: MySQL syntax requires a semicolon (;) at the end of every command. ============================ Creating a database, a table and populating data in it: CREATE DATABASE my_temp; (Creates a new database my_temp) use my_temp; (User now in my_temp) You can alternatively select your database at the command line when mysql is invoked > mysql -u user_name -p my_temp; Creating tables: CREATE TABLE student ( Name varchar(20), SSN int, Department varchar(20), Sex char(1), Date_of_Birth DATE); (creates a new table with the specified description) desc student; ALTER TABLE is used to changing table definition. Adding tuples: INSERT INTO student VALUES ('Jack', '1234567890', 'CS', 'M', '1900-12-31'); INSERT INTO student VALUES ('Jill', '0987654321', 'Arts', 'F', '1901-12-31'); Notice the use of quotes for each entry (necessary as per syntax) MySQL expects date in the YYYY-MM-DD format Query: Once you have have some data, you can run queries on it. select * from student; (shows the tuples in a tabular form) SQL syntax followed in querying. SELECT, UPDATE, INSERT, DELETE etc. Deleting ('drop'ing) tables, databases: DROP TABLE student; (deletes the entire table, definition and data included) DROP DATABASE my_temp; (deletes the entire database) Note: mais oui, Handle with care! To start logging in MySQL, use the 'tee' command in MySQL, specify a file name where the log will be stored (this will be in your home directory): mysql>tee username_spool.log; (starts logging) mysql>notee; (stops logging) ============================= Refer to finer details of using MySQL: http://dev.mysql.com/doc/refman/5.0/en/tutorial.html ============================== PHP/MySQL examples: http://cs.jhu.edu/~ozaidan/DB_HW3/ ==============================