...
NOTE - the actual data in g:\data has not been deleted and is left for the user to do.
Restoring the database on another machine
First back-up the database as above.
On the new machine, install MySQL.
For all steps, you will need to know the MySQL root users password.
- If MySQL root user has a password, all commands below should use the -p switch so you can input the password.
- If MySQL root user does not have a password, use as below.
Create a new instance of a database
Code Block | ||
---|---|---|
| ||
mysql -u root -e "CREATE DATABASE openaudit;" |
Create the Open-AudIT user.
Code Block | ||
---|---|---|
| ||
mysql -u root -e "CREATE USER openaudit@localhost IDENTIFIED BY 'openauditpassword';" |
And allow the user access to the database.
Code Block | ||
---|---|---|
| ||
mysql -u root -e "GRANT ALL PRIVILEGES ON openaudit.* TO openaudit@localhost IDENTIFIED BY 'openauditpassword'; FLUSH PRIVILEGES;" |
Copy the database backup file to the new machine (in this case to /tmp/openaudit_mysql.sql).
Restore the database, as above.