From Helpme

Jump to: navigation, search



MySQL5 can be used on Linux machines in Engineering Design Center.


Account Creation

To use MySQL, you must first have a MySQL account created for you. This account is separate from your normal DC account. To request one, please e-mail

Your MySQL username will be identical to your DC username, but the password is independent. (By default it is set to your Access Card ID with all the leading zeroes)

Database Name

Your database name will be of the format:


If, for example, your username were "testuser", your database would be named:


Database Server

The database server runs on a single system. Its hostname is:


  • To setup MySQL in your environment, type:
setup mysql5
  • Run MySQL by executing:
mysql -h -p -u <username> <db_name>
This will prompt you for your MySQL password. (note: this might be different from your DC account password)
Once authenticated, you will be left at the mysql> prompt.

Web Management Interface (phpMyAdmin)

  • Go to:
  • Pop-up requesting "SCUDC Unix Authentication"
    • Username: <Enter your Design Center username>
    • Password: <Enter your Design Center UNIX password>
  • phpMyAdmin login page
    • Username: <Enter your MySQL username>
    • Password: <Enter your MySQL password>

Connecting via PHP

You can connect to your MySQL database via PHP from the Design Center webserver. A very simple connection example follows:

  • Hostname:
  • Port: 3306
  • Username: <Your MySQL username>
  • Password: <Your MySQL password>
  • Database: sdb_<username>

Simple Mysqli example


$db_host = "";
$db_user = "testuser";
$db_pass = "testpass";
$db_name = "sdb_testuser";

$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name)
        or die("Error" . mysqli_error($conn));

$query = "SHOW DATABASES";

$result = $conn->query($query);

echo "Connected.  Dumping DB list:<br>\n";
while($row = mysqli_fetch_assoc($result)) {
        echo $row['Database'] . "<br>\n";



  • To change your MySQL password, at the mysql> prompt run:
mysql> set password = password("yournewpassword");

Further Reading

  • Thorough MySQL documentation can be found at the MySQL website.
  • A tutorial on connecting to MySQL through PHP is available here.
Personal tools