To restore the database, we need to delete the tables currently in the lams2 database and then run the sql script c:\lams-<date of installation>.bak\dump.sql.
The easiest way to do this is by dropping the current database and creating a new database. The following instructions below describe how to do this using the MySQL Query Browser, which is a GUI client available from the MySQL website (http://dev.mysql.com/downloads/gui-tools/5.0.html).
- Run the MySQL Query Browser.
- Select the lams2 database and click on the triangle to show all the tables in the database.
- Paste the command "DROP DATABASE IF EXISTS lams2;" (without quotes) into the entry window and click execute. This will delete the
existing (partially updated) database.
- Right mouse click on the database list (to get the popup menu) and click Refresh. The lams2 database should be gone.
- Paste the command "CREATE DATABASE lams2 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" (without quotes) into the entry window and click execute. This will create a new database. It is important to use this command to create a new database (rather than using the "Create New Schema" option the CHARACTER SET part ensures that non-English characters will be stored correctly in the database.
- Right mouse click on the database list (to get the popup menu) and click Refresh. An empty lams2 database should now exist.
- Now open the dump script - go to File, Open Script and open c:\lams\dump.sql
- Click execute
- You should end up with all the LAMS tables loaded back into the lams2 database.