473,565 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ERROR 1005 at line 3: Can't create table '.\company\empl oyee.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(DNUM BER)); # 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(DNUM BER))TYPE=InnoD B; #
SHOW CREATE TABLE EMPLOYEE;
SHOW TABLE STATUS FROM COMPANY LIKE "EMPLOYEE";

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

mysql> SHOW VARIABLES LIKE "have_innod b";
+---------------+-------+
| 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 3512

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1162
by: Morten Gulbrandsen | last post by:
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
0
24355
by: CoOL! . | last post by:
Hello, I found the key to solve this problem in: http://darkstar.ist.utl.pt/mysql/doc/en/InnoDB_foreign_key_constraints.html You'll probably need an INDEX for that new foreign key you are declaring in older versions this isn't neccesary but in latest ones it is a restriction. You can have more info about the error description if you...
0
5057
by: Morten Gulbrandsen | last post by:
Hello programmers, I think something is wrong with my administration, Basically I get these messages, ERROR 1005 at line 9: Can't create table '.\company\department.frm' (errno: 150) ERROR 1045: Access denied for user: 'elmasri@127.0.0.1' (Using password: YES)
0
3029
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
2
3320
by: jith87 | last post by:
This is MySql lang...Link nt able to poen so i ve posted here.. What is error 1005 Can't create table (errno:150)....... There is a field X in a table Y. This X field has to be accessed by another table Z.... How to alter table add constraint for the field X in table Z.....
3
1816
by: haries | last post by:
Can anyone diagnose what the problem is in my design , I have a User table and an Entries table with a has_many relation and a FK user_id in Entries. I have now added a new table called EntryStatuses Entry has a has_one EntryStatus relationship. As I try to add the FK entry_id in EntryStatuses, I get an error --...
6
9055
by: daveftl | last post by:
Good day to all...i always have this error after making an ALTER command ... #1005 - Can't create table '.\_ftl\#sql-918_f.frm' (errno: 150) whats the cause of this error...thanks in advance..
1
5157
by: Fischi | last post by:
Hi, I am getting the error message Script line: 84 Can't create table '.\dwh\f_umsatz.frm' (errno: 150) during execution of the following script on a windows system and mysql 5.0: CREATE TABLE d_kunden(id INT NOT NULL AUTO_INCREMENT,
1
1787
by: sprooj | last post by:
hi,I'm trying to add a foreign key constraint to an attribute using MySQL , but an error keeps on appearing : ERROR 1005 (HY000): Can't create table '.\is224\#sql- 110c_1.frm' (errno:150) Can anyone help me with this one.
9
2939
by: AmiMitra | last post by:
i am using mysql 5.1. i have one table named as resv_record. the format is create table resv_record ( book enum('h','c','r','f','t') , resv_id int(8) auto_increment not null , user_id varchar(12) not null , primary key( book , resv_id))engine=myisam; i am creating a new table named flight_book as create table flight_booking ( resv_id int(8)...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.