473,561 Members | 3,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

43 New Member
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 9054
amitpatel66
2,367 Recognized Expert Top Contributor
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 New Member
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.htm l
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 New Member
this is my sql code:

ALTER TABLE Bottles ADD CONSTRAINT trans_Order_Bot tles
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_t rans_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 Recognized Expert Top Contributor
this is my sql code:

ALTER TABLE Bottles ADD CONSTRAINT trans_Order_Bot tles
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_t rans_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 New Member
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 Recognized Expert Top Contributor
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
3590
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. The project's meta information is put into a project table, mysql_insert_id() gets the $proj_ID, and a table named that $proj_ID is created to hold...
1
382
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
12269
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? create table customer_Temp as (select credit_Card_number, personal_id_number from customer) DATA INITIALLY DEFERRED REFRESH deferred; refresh table...
2
13914
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 ( weekstart datetime not null primary key, weekend datetime not null )
3
3864
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
2978
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 a single space if necessary.
4
2316
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, datatypes, table constraints etc.. This XML file should be read and parsed to create a table in SQL according to the specification provided in the...
7
2556
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 could replicate the tool's behavior myself. I am guessing that they work by attempting a non-destructive injection attack against your DB and...
6
4305
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 Alvin Leader
3
2702
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 necessary to install sql server 2000 on that system
0
7637
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
7558
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...
0
7851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7605
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
7924
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...
0
6195
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5462
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
3591
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.