<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MySQL Error Number 1005 Can&#8217;t create table &#8216;.\mydb\#sql-328_45.frm&#8217; (errno: 150)</title>
	<atom:link href="http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/feed/" rel="self" type="application/rss+xml" />
	<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/</link>
	<description>Custom Software</description>
	<lastBuildDate>Fri, 10 Feb 2012 20:13:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Anil</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-5306</link>
		<dc:creator>Anil</dc:creator>
		<pubDate>Thu, 02 Feb 2012 23:30:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-5306</guid>
		<description>Here&#039;s one more possibility:

If you are creating a composite foreign key, then you&#039;ll get &#039;errno: 150&#039; if you qualify the parent table name with its schema name. 

For example, the following throws error 150:

ALTER TABLE schema.tab_1 ADD FOREIGN KEY (a, b) REFERENCES schema.tab_2(a, b)

But the following doesn&#039;t:
ALTER TABLE schema.tab_1 ADD FOREIGN KEY (a, b) REFERENCES tab_2(a, b)

Weird reason, eh? Who&#039;d have thunk about it! This only happens for composite keys. For single keys, having or lacking schema prefix makes no difference.

I think the problem is at the operating system level, when MySQL tries to create and move temp files around during an ALTER operation. Whatever it is, it certainly is a bug. A silly one at that.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s one more possibility:</p>
<p>If you are creating a composite foreign key, then you&#8217;ll get &#8216;errno: 150&#8242; if you qualify the parent table name with its schema name. </p>
<p>For example, the following throws error 150:</p>
<p>ALTER TABLE schema.tab_1 ADD FOREIGN KEY (a, b) REFERENCES schema.tab_2(a, b)</p>
<p>But the following doesn&#8217;t:<br />
ALTER TABLE schema.tab_1 ADD FOREIGN KEY (a, b) REFERENCES tab_2(a, b)</p>
<p>Weird reason, eh? Who&#8217;d have thunk about it! This only happens for composite keys. For single keys, having or lacking schema prefix makes no difference.</p>
<p>I think the problem is at the operating system level, when MySQL tries to create and move temp files around during an ALTER operation. Whatever it is, it certainly is a bug. A silly one at that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elias</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-5302</link>
		<dc:creator>Elias</dc:creator>
		<pubDate>Sat, 28 Jan 2012 15:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-5302</guid>
		<description>When using InnoDB and working between different OS&#039;s (Win and Linux...), watch out for the case-sensativity:
  http://blog.rough-sea.com/2010/06/innodb-the-case-sensitive-monster/

When I set lower_case_table_names to 0, I started getting the 1005 error.</description>
		<content:encoded><![CDATA[<p>When using InnoDB and working between different OS&#8217;s (Win and Linux&#8230;), watch out for the case-sensativity:<br />
  <a href="http://blog.rough-sea.com/2010/06/innodb-the-case-sensitive-monster/" rel="nofollow">http://blog.rough-sea.com/2010/06/innodb-the-case-sensitive-monster/</a></p>
<p>When I set lower_case_table_names to 0, I started getting the 1005 error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4518</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sat, 17 Dec 2011 23:33:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4518</guid>
		<description>thanks, i added it to the article</description>
		<content:encoded><![CDATA[<p>thanks, i added it to the article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MySQL Foriegn Key create ERROR: MySQL Error Number 1005 &#124; Tastala WP0</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4517</link>
		<dc:creator>MySQL Foriegn Key create ERROR: MySQL Error Number 1005 &#124; Tastala WP0</dc:creator>
		<pubDate>Sat, 17 Dec 2011 14:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4517</guid>
		<description>[...] Jason summarized very good article to track down error reported on his blog. [...]</description>
		<content:encoded><![CDATA[<p>[...] Jason summarized very good article to track down error reported on his blog. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krishnamurthy</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4516</link>
		<dc:creator>krishnamurthy</dc:creator>
		<pubDate>Sat, 17 Dec 2011 10:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4516</guid>
		<description>your post helped me a lot.
my problem was #3. my foriegn key name was not unique.</description>
		<content:encoded><![CDATA[<p>your post helped me a lot.<br />
my problem was #3. my foriegn key name was not unique.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Noyes</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4513</link>
		<dc:creator>Scott Noyes</dc:creator>
		<pubDate>Thu, 15 Dec 2011 17:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4513</guid>
		<description>&quot;SHOW INNODB STATUS&quot; is deprecated in 5.0 and removed in 5.5. It&#039;s &quot;SHOW ENGINE INNODB STATUS&quot; now.</description>
		<content:encoded><![CDATA[<p>&#8220;SHOW INNODB STATUS&#8221; is deprecated in 5.0 and removed in 5.5. It&#8217;s &#8220;SHOW ENGINE INNODB STATUS&#8221; now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JS</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4500</link>
		<dc:creator>JS</dc:creator>
		<pubDate>Fri, 02 Dec 2011 19:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4500</guid>
		<description>thanks guys for the suggestions! keep up the good work :-) , what worked for me this: make sure the foreign key field exist in the table in wich you make a reference from to another table. not only in a manually create table statement the line : foreign key (test) references table(test). (like my teacher said ^^) 
also what worked after all was to just create the table and then alter the table, add a field and add the foreign key.</description>
		<content:encoded><![CDATA[<p>thanks guys for the suggestions! keep up the good work <img src='http://verysimple.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  , what worked for me this: make sure the foreign key field exist in the table in wich you make a reference from to another table. not only in a manually create table statement the line : foreign key (test) references table(test). (like my teacher said ^^)<br />
also what worked after all was to just create the table and then alter the table, add a field and add the foreign key.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4499</link>
		<dc:creator>Heiko</dc:creator>
		<pubDate>Thu, 01 Dec 2011 20:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4499</guid>
		<description>&quot;One of the fields in the relationship is part of a combination (composite) key and does not have it’s own individual index. Even though the field has an index as part of the composite key, you must create a separate index for only that key field in order to use it in a constraint. (Thanks to Alex for this tip)&quot;

This was my problem, but even after I read it, it took me a while to figure it out.

You need to create an INDEX on the column you are referencing on the PARENT table.</description>
		<content:encoded><![CDATA[<p>&#8220;One of the fields in the relationship is part of a combination (composite) key and does not have it’s own individual index. Even though the field has an index as part of the composite key, you must create a separate index for only that key field in order to use it in a constraint. (Thanks to Alex for this tip)&#8221;</p>
<p>This was my problem, but even after I read it, it took me a while to figure it out.</p>
<p>You need to create an INDEX on the column you are referencing on the PARENT table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ADD Constraint liefert #1005 - Can't create table 'x.#sql-e24_25 (Beispiel sql dabei) - PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4489</link>
		<dc:creator>ADD Constraint liefert #1005 - Can't create table 'x.#sql-e24_25 (Beispiel sql dabei) - PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr</dc:creator>
		<pubDate>Tue, 22 Nov 2011 20:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4489</guid>
		<description>[...] UNIQUE INDEX das Problem behoben.  Hier habe ich letztendlich die Info bei Known Issues gefunden: MySQL Error Number 1005 Can&#8217;t create table &#8216;.mydb#sql-328_45.frm&#8217; (errno: 150) &#124; V...     __________________ SQL Injection kitteh [...]</description>
		<content:encoded><![CDATA[<p>[...] UNIQUE INDEX das Problem behoben.  Hier habe ich letztendlich die Info bei Known Issues gefunden: MySQL Error Number 1005 Can&#8217;t create table &#8216;.mydb#sql-328_45.frm&#8217; (errno: 150) | V&#8230;     __________________ SQL Injection kitteh [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sabri Moussi</title>
		<link>http://verysimple.com/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/#comment-4482</link>
		<dc:creator>Sabri Moussi</dc:creator>
		<pubDate>Thu, 17 Nov 2011 20:22:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=58#comment-4482</guid>
		<description>I have been having problems in getting this to work....: 

CREATE TABLE Booking (
cottageNo char(5) not null, 
customerNo char(5),
dateFrom date,
dateTo date,
status varchar(10),
primary key(dateFrom),
foreign key (status) REFERENCES cottage ON DELETE SET NULL ON UPDATE CASCADE);

Any suggestions?? I am using the InnoDB.</description>
		<content:encoded><![CDATA[<p>I have been having problems in getting this to work&#8230;.: </p>
<p>CREATE TABLE Booking (<br />
cottageNo char(5) not null,<br />
customerNo char(5),<br />
dateFrom date,<br />
dateTo date,<br />
status varchar(10),<br />
primary key(dateFrom),<br />
foreign key (status) REFERENCES cottage ON DELETE SET NULL ON UPDATE CASCADE);</p>
<p>Any suggestions?? I am using the InnoDB.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

