MySQL database support is provided as a service for iHost users. By running php programming language on the iHost server, you can write programs to access MySQL database for applications such as addressbook, online surveys, and more.

A default database called “acctname_db” (e.g. webitsc_db) will be created along with your iHost account. You can manage your database using mysql username (the same name as your iHost account) and mysql password. For the database server, please specifiy localhost.

Working with MySQL Database

Access Your Database via phpMyAdmin

Before writing programs to access MySQL database from the iHost server, you may want to create the required tables using the phpMyAdmin interface, depending on which web hosting server:

https://webhost3.ust.hk/phpmyadmin/index.php

or

https://webhost5.ust.hk/phpmyadmin/index.php

After logging on to phpMyAdmin using your mysql username and mysql password, it is straightforward to manipulate your database. For example, you can create new tables, flush the table to reclaim space from deleted records, export your database to files, etc.

Back Up/Restore Your Database

You are advised to backup databases regularly to prevent data loss:

  1. Log on to phpMyAdmin using your mysql username (the same as your iHost account) and mysql password.
  2. Select the database to be backed up from the column on the left, e.g. webitsc_db.
  3. Click on the Export tab.
  4. Check the Save as File option.
  5. Click the Go button to save the database to your local hard disk.

Restoring your database is as easy as backing it up but be aware that you will lose all changes since your last backup. To reload your backup to overwrite your database:

  1. Log on to phpMyAdmin using your mysql username (the same as your iHost account) and mysql password.
  2. Select the database from the column on the left, e.g. webitsc_db.
  3. Click all the check boxes next to the table names.
  4. Select Drop in the With Selected drop down listbox and click Yes to confirm removing all your data.
    Note: You will lose all your data after this action until you successfully restore your last backup. However, any changes to your database after your last backup will be lost.
  5. Click on the Import tab.
  6. Click on the Browse button and select the SQL backup file you wish to upload to the server.
  7. Click the Go button to confirm the reload.

Change mysql Password

For webhost3 and webhost5:

You can change your mysql password inside phpmyadmin. Please do remembe the mysql password as it cannot be reset.