468,103 Members | 1,243 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

ERROR 1005 at line 3: Can't create table '.\company\employee.frm' (errno: 150)

USE company;
DROP TABLE IF EXISTS EMPLOYEE;
CREATE TABLE EMPLOYEE
(
# PK
SSN CHAR(9) NOT NULL,
# FK
SUPERSSN CHAR(9),
DNO INT NOT NULL DEFAULT 1,
CONSTRAINT EMPPK
PRIMARY KEY (SSN),
FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN), # THIS runs
FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER)); # TYPE=InnoDB
SHOW CREATE TABLE EMPLOYEE;
SHOW TABLE STATUS FROM COMPANY LIKE "EMPLOYEE";

================================================== ======================
USE company;
DROP TABLE IF EXISTS EMPLOYEE;
CREATE TABLE EMPLOYEE
(
# PK
SSN CHAR(9) NOT NULL,
# FK
SUPERSSN CHAR(9),
DNO INT NOT NULL DEFAULT 1,
CONSTRAINT EMPPK
PRIMARY KEY (SSN),
FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN), # THIS woun't DO !!!
FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER))TYPE=InnoDB; #
SHOW CREATE TABLE EMPLOYEE;
SHOW TABLE STATUS FROM COMPANY LIKE "EMPLOYEE";

C:\mysql\bin>mysql < Company_00.sql > out.txt
ERROR 1005 at line 3: Can't create table '.\company\employee.frm'
(errno: 150)
What can I DO ?

mysql> SHOW VARIABLES LIKE "have_innodb";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_innodb | YES |
+---------------+-------+
1 row in set (0.00 sec)

mysql>

Yours Sincerely

Morten Gulbrandsen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 3238

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Morten Gulbrandsen | last post: by
reply views Thread by Morten Gulbrandsen | last post: by
1 post views Thread by Fischi | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.