[NCLUG] mysql: backing up database - cannot save relationships

Chris Ernst penguin-guy at comcast.net
Fri Aug 9 08:39:34 MDT 2013


On 08/08/2013 07:27 PM, phil marsh wrote:
> I also notice that in the exported database file (.sql format) that there are no foreign keys specified. Pardon my ignorance but aren't the relations specified via foreign keys?
> If so, does that mean I need to be using the InnoDB engine instead of the default MyISAM engine?
> If the above are true, then how does mysql even use relationships with the MyISAM engine in phpmyadmin (front end for MySQL) (which I'm doing quite well)?

Hi Phil,

When you use the MyISAM engine, MySQL allows you to specify foreign
keys, but doesn't enforce them or even store them.  Basically, it just
allows you to pretend that you have foreign keys.

See: http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-foreign-keys.html

If you want actual foreign keys, you'll need to switch to the InnoDB
engine or, even better IMHO, PostgreSQL.

Cheers!

	- Chris




More information about the NCLUG mailing list