MySQL user documentation

From Syscore

(Redirected from MySQL)

Contents

Using mysql.gl

About the OIT-maintained mysql.gl server

OIT maintains a MySQL server for general user and department use. If your department already maintains a MySQL for its own purposes, please try to obtain an account on that first.

The current version of the MySQL server that OIT maintains is 4.1.18, however the MySQL clients installed on the GL system are 5.0.18. This allows you more flexibility in the types of MySQL servers you may have to connect to if you do not use the OIT server.

Accessing your mysql.gl account

To access MySQL for your class, you must first have a myUMBC/Unix account. If you do not have one, please see the Helpdesk in room ECS020. Once you have that, your teacher must have requested MySQL accounts for the students in your class, which would get you to here. Now, to log into MySQL to begin your work, please follow the following steps.

First log into your UMBC Unix account through ssh. This can be your GL account, Research account, and possibly other departmental accounts. Once you have logged in, create a .my.cnf file with your preferred text editor (emacs, vi, pico, etc) with the following contents:

[mysql]
database = <your database name (same as username)>
password = <your assigned MySQL account password>

Then execute the MySQL client command:

mysql

The mysql command will read the contents of your .my.cnf file and will log you in to your account on the MySQL server. You will see a prompt, at which you will type your SQL commands.

Helpful Tips

  • You can dump the entire contents of your MySQL database using the mysqldump command.
  • There are ODBC drivers for Windows and MacOS available from MySQL.org
  • If you are setting up a popular PHP-based web service such as phpBB, MediaWiki, Gallery, or similar, and are asked which hostname to connect to for the MySQL database, enter: mysql.gl.umbc.edu

Using MySQL from PHP

Using MySQL from PHP from the Core Web Environment, including userpages.umbc.edu, is very simple.

To connect to the database, you should use a statement simliar to this:

$conn = mysql_connect( "mysql.gl.umbc.edu", $username, $password );

It is then an excercise for the reader to learn and write the relevant PHP code to insert and extract data from their MySQL database. For in-depth instructions on accessing data in a MySQL database, please refer to the PHP documentation located at http://php.net/manual/en/ref.mysql.php

Web-based MySQL access

OIT offers a web interface to your MySQL account(s) using phpMyAdmin. This interface allows you to better visualize the data in your tables and is quite useful for everyone, especially MySQL beginners. You may use this web interface by navigating to the following link in your web browser and logging in with your MySQL user name and password (Note: your MySQL password is not your myUMBC password).

OIT MySQL web interface: https://webadmin.umbc.edu/mysqladmin

Requesting MySQL Accounts For a Course

MySQL database accounts are available for any course to use, just send an email to helpdesk@umbc.edu stating that you want to request mysql.gl accounts be generated for your class. The only information we need is the semester, course code, and section number. We will automatically generate accounts for all the students that are currently enrolled in the class and for yourself (if you don't already have an account). If you would like accounts generated for any TA's you may have, please include their usernames.

The student accounts will be deleted not less than one month after the end of the semester. Please ensure they are aware of this policy.