Mysqldump of your database » History » Version 6
Anchi Cheng, 08/01/2019 12:29 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 | 6 | Anchi Cheng | |
13 | 1 | Anchi Cheng | <pre> |
14 | mysqldump -h your_host -u usr_object -p leginondb > your_leginondb_dump.sql |
||
15 | mysqldump -h your_host -u usr_object -p projectdb > your_projectdb_dump.sql |
||
16 | </pre> |
||
17 | |||
18 | Each of these commands will ask you for the password. |
||
19 | 2 | Anchi Cheng | |
20 | 5 | Anchi Cheng | h2. Individual table |
21 | |||
22 | That's say you want to dump FocuserSettingsData table from leginon database that is called leginondb, you should do |
||
23 | |||
24 | <pre> |
||
25 | mysqldump -h your_host -u usr_object -p leginondb FocuserSettingsData > your_table_dump.sql |
||
26 | </pre> |
||
27 | 6 | Anchi Cheng | |
28 | For multiple tables, append them at the end like this example where we dump all focuser related tables. |
||
29 | <pre> |
||
30 | mysqldump -h your_host -u usr_object -p leginondb FocuserSettingsData FocusSettingsData FocusSequenceData > your_focuser_dump.sql |
||
31 | </pre> |
||
32 | |||
33 | 2 | Anchi Cheng | |
34 | 3 | Anchi Cheng | ________________ |
35 | |||
36 | 4 | Anchi Cheng | [[Load mysqldumped databases|Load the saved databases >]] |