Project

General

Profile

Mysqldump of your database » History » Version 5

Anchi Cheng, 08/01/2019 12:26 PM

1 1 Anchi Cheng
h1. Mysqldump of your databases
2
3
mysqldump is a tool comes with mysql installation that creates mysql commands that can reproduce the database when executed on a different host.
4
5
If you run into problems that you can not decribe the history of getting there to leginon team, this might be the best way for us to dicover what went run.
6
You will need help from the person who installed the packages if you don't know what the name of the databases are and the mysql user that have the permission to do this.
7
A hint: the information is in sinedon.cfg
8
9
Once these are figured out, here is the command using our standard naming used in this wiki.
10
11 5 Anchi Cheng
h2. whole leginon and project databases
12 1 Anchi Cheng
<pre>
13
mysqldump -h your_host -u usr_object -p leginondb > your_leginondb_dump.sql
14
mysqldump -h your_host -u usr_object -p projectdb > your_projectdb_dump.sql
15
</pre>
16
17
Each of these commands will ask you for the password.
18 2 Anchi Cheng
19 5 Anchi Cheng
h2. Individual table
20
21
That's say you want to dump FocuserSettingsData table from leginon database that is called leginondb, you should do
22
23
<pre>
24
mysqldump -h your_host -u usr_object -p leginondb FocuserSettingsData > your_table_dump.sql
25
</pre>
26 2 Anchi Cheng
27 3 Anchi Cheng
________________
28
29 4 Anchi Cheng
[[Load mysqldumped databases|Load the saved databases >]]