is there a permission problem that is not allowing you to see the file? what user runs mysqld?
there must be an example of a my.cnf file somewhere on the mysql website. grab it, set up innodb data files, and if you want, log files.
good luck
jeff
Rhino wrote:
I tried adding that space after the closing parenthesis in both Create Table statements; it made no difference at all.
You're probably right about the InnoDB support not being turned on. I read the article about configuring my.cnf and wanted to try playing with the settings but I'm darned if I can find the my.cnf file!
a) I have no file called /etc/my.cnf. b) I think MySQL was installed from an RPM as a binary but I don't recall for sure. I'm not sure though so I checked /usr/local/mysql/data: I have a /usr/local but no mysql directory in /usr/local. I also checked /usr/local/var: I have no var directory in /usr/local. c) I have no idea what was specified with --defaults-extra-file= and have no idea how to find out. d) I have no file called .my.cnf in my home directory (/home/rhino).
Any idea where I can find my my.cnf file? (For what it's worth, I tried find / -name 'my.cnf' but got the message "Permission denied". I'm not sure why permission is denied; I don't use Linux very often and haven't used it much in several months but I know the 'find' command worked last time I tried it....).
Anyway, if anyone could tell me how to find my.cnf and verify that InnoDB is set up correctly, I'd appreciate it.
Rhino
----- Original Message ----- From: "Jeff Mathis" <[EMAIL PROTECTED]>
To: "Rhino" <[EMAIL PROTECTED]>
Cc: "mysql" <[EMAIL PROTECTED]>
Sent: Friday, February 13, 2004 6:44 PM
Subject: Re: Newbie Question
might be as simple as putting a space after your closing parenthesis on the create table statement.
either that, or your mysql install somehow doesn't have innodb table support. have you edited your my.cnf file and enabled the innodb parameters, specifically log and data files?
Rhino wrote:
I'm new to MySQL but I have extensive experience with DB2 so I'm getting quite confused about how MySQL is supposed to work.
I am using MySQL 4.0.11 on a Linux server running RedHat 9.2. I am trying to create a pair of InnoDB tables that are related to one another via a foreign key. I created the tables successfully but when I try to insert a row into the child table that violates the foreign key, MySQL loads the bad row, even though the foreign key doesn't exist!
Here is the script I used to create and populate the tables: -------------------------------------------------------------- use Sample;
drop table if exists dept; create table dept( deptno char(3) not null, deptname varchar(36) not null, mgrno char(6), primary key(deptno) )Type=InnoDB;
drop table if exists emp; create table emp( empno char(6) not null, firstnme char(12) not null, midinit char(1), lastname char(15) not null, workdept char(3) not null, salary dec(9,2) not null, primary key(empno), index(workdept), foreign key(workdept) references dept(deptno) on delete restrict )Type=InnoDB;
insert into dept values ('A00', 'Administration', '000010'), ('D11', 'Manufacturing', '000020'), ('E21', 'Education', '000030');
insert into emp values ('000010', 'Christine', 'I', 'Haas','A00',50000.00), ('000020', 'Cliff', ' ', 'Jones', 'D11', 30000.00), ('000030', 'FK', ' ', 'Mistake', 'X99', 12345.67), ('000040', 'Brad', ' ', 'Dean', 'E21', 35000.00); -------------------------------------------------------------------
I got a very big clue when I ran this command: show table status from Sample;
It showed that my two tables were type "MyISAM", *not* "InnoDB". If my tables really are "MyISAM", then I'm not surprised that the foreign key constraint doesn't work since MyISAM doesn't support foreign keys, at least as I understand the manual.
However, this doesn't answer the big question: *Why* aren't my tables InnoDB since I explicitly defined them that way??
Can any MySQL veterans clear up this mystery for me?
Rhino --- rhino1 AT sympatico DOT ca "If you want the best seat in the house, you'll have to move the cat."
-- Jeff Mathis, Ph.D. 505-955-1434 The Prediction Company [EMAIL PROTECTED] 525 Camino de los Marquez, Ste 6 http://www.predict.com Santa Fe, NM 87505
-- Jeff Mathis, Ph.D. 505-955-1434 The Prediction Company [EMAIL PROTECTED] 525 Camino de los Marquez, Ste 6 http://www.predict.com Santa Fe, NM 87505
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]