or download this
$> mysqldump -d my_database > my_database_structure.sql
#the -d is to not include the data simply the table structure of the d
+atabase.
$> perl db_relation.pl my_database_structure.sql > my_database_relatio
+ns.txt
#the script will print to STDOUT unless directed to a textfile.