So, I'm trying to export all the DB structure of my MySQL db.
Attached is my DB structure, I have more then this, but I want these tables only.
Basically Tools relate to Factsheets and Factsheets to Content and Images, then to everything else.
I need to export based on TOOL ID. Which is only defined on the Factsheets table as a FK and PK only on the Tools Table.
Any ideas?
I can do command line, mysql workbence or PHP-my admin.
UPDATE #1:
Ok to clear some stuff up, lets forget about glossary. A tool is a collection of factsheets, factsheets are collections of factsheetcontent (1 factsheet to many contents) and each piece of factsheetcontent is related to one factsheettitle.
Basically, I'm needing to query based on the TOOLID, ex the Citrus Pests tool with ID of 2, to get all the factsheets which then get all the content under them.
Relations:
Tool to Factsheet: 1 to Many
Factsheet to FactsheetContent: 1 to Many
FactsheetContent to FactsheetTitle: 1 to Many
Factsheet to FactsheetImages: 1 to many
FactsheetImages to image: 1 to 1
Starting from the tool I need to get factsheets, then all things under them. I need the Database structure. Otherwise I'd do a Select with a bunch of joins and export to a CSV
This is what I need, we can drop the glossary as thats not needed. This is what I'm after, using the command line mysqldump works great for the 2 table that has the toolid, after that it quickly fails and blows apart--starts to throw lots of errors.
Any ideas?
Error I get using RolandoMySQLDBA suggestion:
./getDbtablesBasedOnToolID
: command not foundnToolID: line 6:
ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user '-p'@'localhost' (using password: NO) : command not foundnToolID: line 22: : command not foundnToolID: line 32: '@'localhost' (using password: NO) when trying to connect : command not foundnToolID: line 39: '@'localhost' (using password: NO) when trying to connect : command not foundnToolID: line 46: '@'localhost' (using password: NO) when trying to connect : command not foundnToolID: line 53: '@'localhost' (using password: NO) when trying to connect : command not foundnToolID: line 60: '@'localhost' (using password: NO) when trying to connect