MySQL database support is provided as a service for personal homepage. By running php programming language on the server, you can write programs to access MySQL database for applications such as address book, online surveys, and more.
A default database (e.g. 1001_db) will be created along with your personal homepage account (the database server name "localhost".) You can manage the database using your mysql username (e.g. user1001) and the Initial mysql password.
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:
https://home.<hostname>.ust.hk/phpmyadmin/ |
i.e.
For Staff: https://home.people.ust.hk/phpmyadmin/
For Student: https://home.student.ust.hk/phpmyadmin/
For Student Society: https://websoc.hkust.edu.hk:9003/phpmyadmin/ (Old: https://home.student.ust.hk/phpmyadmin/)
For Alumni Association: https://websoc.hkust.edu.hk:9003/phpmyadmin/ (Old: https://sftp.alumni.ust.hk/phpmyadmin/)
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:
- Log on to phpMyAdmin using your mysql username (the same as your iHost account) and mysql password.
- Select the database to be backed up from the column on the left, e.g. 1023_db.
- Click on the Export tab.
- Check the Save as File option.
- 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:
- Log on to phpMyAdmin using your mysql username (the same as your iHost account) and mysql password.
- Select the database from the column on the left, e.g. 1023_db.
- Click all the check boxes next to the table names.
- 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. - Click on the Import tab.
- Click on the Browse button and select the SQL backup file you wish to upload to the server.
- Click the Go button to confirm the reload.
Change mysql Password (optional)
You can change your mysql password inside phpmyadmin if it is necessary.
https://home.<hostname>.ust.hk/phpmyadmin |
i.e.
For Staff: https://home.people.ust.hk/phpmyadmin/
For Student: https://home.student.ust.hk/phpmyadmin/
For Student Society: https://websoc.hkust.edu.hk:9003/phpmyadmin/ (Old: https://home.student.ust.hk/phpmyadmin/)
For Alumni Association: https://websoc.hkust.edu.hk:9003/phpmyadmin/ (Old: https://sftp.alumni.ust.hk/phpmyadmin/)
Note: To change the SQL password for Student Society/Alumni Association, please run the following SQL command within phpmyadmin:
alter user 'userxxxx'@'localhost' identified by '<new password>';
Do rember your new mysql password as it will not shown in Your Personal Homepage Quota and MySQL settings and you cannot reset it again.
- Staff Account
- Student Account
- Student Society Account
- MySQL Info (Old: su.ust.hk)
- MySQL Info (New: su.hkust.edu.hk)
- Alumni Association
- MySQL Info (Old: alumni.ust.hk)
- MySQL Info (New: alumni.hkust.edu.hk)