Reader's Comments

on Introduction to Database Management Systems
Actually, the ACM do make A Relational Model of Data for Large Shared Data Banks freely available, but that's the exception rather than the rule.

-- Tom L, November 26, 2003
I'm using MySQL, and I wanted to comment on a snag I ran into while I was following the tutorial in this page. Maybe other newbies can benefit from this.

As far as I can tell:

a) MySQL supports different "storage engines" for tables. This is presumably a good thing. However, not all engines support referencial constraints.

b) For a MySQL table to support a "references" constraint, it must be of type InnoDB. In my installation (on SuSE Linux, right out of a standard RPM binary package), this is *not* the default. So you have to either change the server configuration to make this the default, or specify "ENGINE = InnoDB" after the closing parenthesis in the table definition.

c) Even for InnoDB, the syntax described by Phil above does not work, though it is not rejected, merely ignored. According to the manual, this is effectively just a comment to the developer that this column is supposed to reference another column, even if the constraint is not enforced by mysql.

d) So, the only way to make this kind of constraint work is to: 1. make the table InnoDB and 2. use the "FOREIGN KEY (email) REFERENCES mailing_list(email)" format as a separate entry inside the table definition.

[MySQL won't even give a warning! Not even a reminder that such reference clauses are merely "comments". It will just happily ignore them and allow any old value in that row. Ugh.]

-- Antonio Ramirez, March 19, 2007

Another addendum for MySQL is that "The CHECK clause is parsed but ignored by all storage engines" (http://dev.mysql.com/doc/refman/5.1/en/create-table.html). The CHECK can be accomplished, however, with an appropriate TRIGGER.

-- Eddie Marks, June 22, 2010
I'd avoid MySQL when learning about RDBMSes - it's philosophically a bit different, as evidenced by the silent errors and nondefault status of InnoDB. I use PostGres instead - it's free, and the command line tools are excellent. It's straightforward to configure and install, and has mature support pretty much anywhere you care to use it.

-- chris cooney, September 2, 2010

The default storage engine can be changed in the MySQL config file, which on Linux (e.g. RHEL, CentOS, Debian, SLES, etc.) is stored at /etc/my.cnf

Within that file there SHOULD be a section labeled [mysqld]. Add the following line immediately below that label so that the result is as follows:

[mysqld]
default-storage-engine = myisam

You will then need to restart the mysqld process. There are different ways to accomplish this task depending upon your version of Linux. One way is as follow:

/etc/init.d/mysql stop
/etc/init.d/mysql start

Enjoy!



-- Cai Black, June 9, 2011
Add a comment