Manual Database Backup

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(New page)
 
Line 1: Line 1:
To backup the MySQL database, use the following commands:
+
To backup the MySQL database, use the following commands:  
<pre>mysqldump -u tbdb -ptbdbpw --opt toolpack_0 &gt; toolpack_0_bk.sql</pre>
+
<pre>mysqldump -u tbdb -ptbdbpw --opt toolpack_0 &gt; toolpack_0_bk.sql</pre>  
Then, you need to save the "toolpack_0_bk.sql" file in a safe place.
+
Then, you need to save the "toolpack_0_bk.sql" file in a safe place.  
  
You can recover the database this way:
+
You can recover the database this way:  
<pre>mysql -u tbdb -ptbdbpw toolpack_0 &lt; toolpack_0_bk.sql</pre>
+
<pre>mysql -u tbdb -ptbdbpw toolpack_0 &lt; toolpack_0_bk.sql</pre>  
This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)<br><br>
+
This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)<br><br>
 +
 
 +
Here are other useful mysql commands:
 +
<pre>mysql –u tbdb –p tbdbpw
 +
use toolpack_0;
 +
show tables;
 +
SELECT * from system_infos;
 +
SELECT * from mysql.user;</pre>
 +
And to work with the MySQL service:<br>
 +
<pre>service mysqld stop
 +
service mysqld start
 +
ps -ef | grep mysqld
 +
</pre>

Revision as of 13:02, 10 May 2011

To backup the MySQL database, use the following commands:

mysqldump -u tbdb -ptbdbpw --opt toolpack_0 > toolpack_0_bk.sql

Then, you need to save the "toolpack_0_bk.sql" file in a safe place.

You can recover the database this way:

mysql -u tbdb -ptbdbpw toolpack_0 < toolpack_0_bk.sql

This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)

Here are other useful mysql commands:

mysql –u tbdb –p tbdbpw
use toolpack_0;
show tables;
SELECT * from system_infos;
SELECT * from mysql.user;

And to work with the MySQL service:

service mysqld stop
service mysqld start
ps -ef | grep mysqld
Personal tools