The CS department offers a MySQL database account to anyone who has a computer science account for use with class related projects or their own personal projects. The database may be accessed via a command line application (mysql) or through student created applications. The department does not automatically create a database account for everyone; instead each student must request a database account. (If you are registered for a database course, your account should be created for you automatically, however.) This how-to describes how to request a database account and how to connect to the database via a command line application. This how-to does not describe how to connect your application to the database; for information on how to do this consult the documentation for your platform (php, java, asp, .net, etc.) or your TA / Instructor.
After submitting the request it will take a day or two for it to be processed. Once it is processed your initial database password will be set to your student ID number.
There are several ways to connect to the MySQL database. You may connect via a command line application which allows you to directly enter SQL queries or have your application connect to the database.
> mysql -h database.cs.tamu.edu -u yourusername -p
|
Welcome to the MySQL monitor. Commands end with ; or \g.
|
From this prompt you may enter SQL queries to access the database. To quit mysql use the 'quit' command.
Once you get your database account activated, one of the first things you will want to do is change the initial password to something more secure. To change your password, first login as described above, and then enter the following command:
SET PASSWORD = OLD_PASSWORD('yournewpassword');
|
An example of this would be "SET PASSWORD = OLD_PASSWORD('1wiwgp4u');"
Note that the password you are typing in the parenthesis and single quotes is your new password; the "OLD_PASSWORD" just means that it is being stored in the old password format. If you forget your password or have any problem changing it, visit the helpdesk in room 210 for assistance.
You can create multiple databases, but the names of your databases must be either:
your_username oryour_username-*For example, if your username where student, and you
already had a database named student, you would type
the following commands to:
mysql> create database `student-db1`
|
mysql> use student-db1;
|
mysql> use student;
|
mysql> drop database 'student-db1';
|
For more information on how to use mysql, the features of MySQL, or general information about SQL visit these websites.
The MySQL Reference Manual.
The MySQL documentation.
An introductory tutorial for SQL.
Monday - Friday:
7 am - Midnight
Saturday:
10 am - 7 pm
Sunday:
12 pm - Midnight
Hours subject to change during holidays, emergencies, and summer semester.