473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

error: #1005 - Can't create table '.\_ftl\#sql-918_f.frm' (errno: 150)

43
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..
Oct 25 '07 #1
6 9050
amitpatel66
2,367 Expert 2GB
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..
Could you please POST the output after executing the below command:

mysql> show innodb status;
Oct 25 '07 #2
daveftl
43
mysql> show innodb status;

| Status


=====================================
071025 19:07:59 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 54 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 7, signal count 7
Mutex spin waits 0, rounds 40, OS waits 2
RW-shared spins 8, OS waits 4; RW-excl spins 1, OS waits 1
------------------------
LATEST FOREIGN KEY ERROR
------------------------
071025 18:17:38 Error in foreign key constraint of table _ftl/#sql-918_f:

FOREIGN KEY (Order_Id, cust_ID) REFERENCES trans_Order (Order_Id,cust_ID):
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint.
Note that the internal storage type of ENUM and SET changed in
tables created with >= InnoDB-4.1.12, and such columns in old tables
cannot be referenced by such columns in new tables.
See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
for correct foreign key definition.
------------
TRANSACTIONS
------------
Trx id counter 0 1328
Purge done for trx's n:o < 0 1299 undo n:o < 0 0
History list length 4
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, OS thread id 2868
MySQL thread id 19, query id 345 localhost 127.0.0.1 root
show innodb status
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
49 OS file reads, 58 OS file writes, 27 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 62383, used cells 0, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 0 98760
Log flushed up to 0 98760
Last checkpoint at 0 98760
0 pending log writes, 0 pending chkp writes
25 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 23277710; in additional pool allocated 1412480
Buffer pool size 960
Free buffers 917
Database pages 42
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 39, created 3, written 35
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread id 3208, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
1 row in set, 1 warning (0.00 sec)

mysql> clear;
mysql>
Oct 25 '07 #3
daveftl
43
this is my sql code:

ALTER TABLE Bottles ADD CONSTRAINT trans_Order_Bottles
FOREIGN KEY (Order_Id, cust_ID) REFERENCES trans_Order (Order_Id,cust_ID);

ALTER TABLE trans_Order ADD CONSTRAINT Customer_trans_Order
FOREIGN KEY (cust_ID) REFERENCES Customer (cust_ID);

ALTER TABLE trans_Order ADD CONSTRAINT trans_Payment_trans_Order
FOREIGN KEY (Payment_Id) REFERENCES trans_Payment (Payment_Id);

ALTER TABLE trans_Payment ADD CONSTRAINT Customer_trans_Payment
FOREIGN KEY (cust_ID) REFERENCES Customer (cust_ID);

is there wrong with the code?
thanks for the help...
Oct 25 '07 #4
amitpatel66
2,367 Expert 2GB
this is my sql code:

ALTER TABLE Bottles ADD CONSTRAINT trans_Order_Bottles
FOREIGN KEY (Order_Id, cust_ID) REFERENCES trans_Order (Order_Id,cust_ID);

ALTER TABLE trans_Order ADD CONSTRAINT Customer_trans_Order
FOREIGN KEY (cust_ID) REFERENCES Customer (cust_ID);

ALTER TABLE trans_Order ADD CONSTRAINT trans_Payment_trans_Order
FOREIGN KEY (Payment_Id) REFERENCES trans_Payment (Payment_Id);

ALTER TABLE trans_Payment ADD CONSTRAINT Customer_trans_Payment
FOREIGN KEY (cust_ID) REFERENCES Customer (cust_ID);

is there wrong with the code?
thanks for the help...

Can you please check if the table trans_order has the primary key (order_id,cust_id) created? If not create the composite key first in trans_order and then create foreign key
Oct 25 '07 #5
daveftl
43
Can you please check if the table trans_order has the primary key (order_id,cust_id) created? If not create the composite key first in trans_order and then create foreign key
that was the reason of the error...the composite key was not created first...thanks a lot! God bless
Oct 25 '07 #6
amitpatel66
2,367 Expert 2GB
that was the reason of the error...the composite key was not created first...thanks a lot! God bless
Thank you for those Blessings :-)
DO POST back any issues you face in future!!
We will help you out!!
Oct 25 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Andrew | last post by:
I have a problem creating mySQL tables with PHP. I am making an app where a user can create a project. Pressing "submit" on proj_form.php goes to proj_add.php where a couple of things happen. ...
1
by: JS | last post by:
I have just installed Mysql on winXP. When I get to the mysql promt and type: create table mytable(id int); I get this error: ERROR 1046 <3D000>: No database selected
6
by: Bruce | last post by:
I want to create a new table based on an existing table, but I don't want the tables to have any enforced relationship. Is this possible without having to do a CREATE TABLE and an INSERT? ...
2
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks (...
3
by: blindsey | last post by:
Is there a tool that can take an Access database and generate SQL "CREATE TABLE" statements for all the tables in it?
3
by: --[zainy]-- | last post by:
AA! I am having problems on creating table through Enterprise Manager. It gives me Error 1038 i.e. is as follows Unexpected Error ODBC error: Cannot use empty object or column names. Use...
4
by: Priya | last post by:
Hey all, Is there a way to create a table in the SQL database by using an XML file as an input? I want to have an XML file which holds all the details of the table like the tablename, columns,...
7
by: | last post by:
There are assorted "SQL Injection vulnerability assessment tools" out there. They scan your site and send your report. They also take your money. We don't have the money so I was wondering if I...
6
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B ...
3
by: ashdaredevil | last post by:
I have created a Project which has a SQL sever 2000 database and when I setup that project and installed it on another system which haven't sql server 2000 , the connection error displayed Is it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.