<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://deltanine.net/mw/index.php?action=history&amp;feed=atom&amp;title=MySQL_InnoDB_Foreign_Key_Error</id>
	<title>MySQL InnoDB Foreign Key Error - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://deltanine.net/mw/index.php?action=history&amp;feed=atom&amp;title=MySQL_InnoDB_Foreign_Key_Error"/>
	<link rel="alternate" type="text/html" href="https://deltanine.net/mw/index.php?title=MySQL_InnoDB_Foreign_Key_Error&amp;action=history"/>
	<updated>2026-04-27T19:10:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.1</generator>
	<entry>
		<id>https://deltanine.net/mw/index.php?title=MySQL_InnoDB_Foreign_Key_Error&amp;diff=667&amp;oldid=prev</id>
		<title>Chris: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://deltanine.net/mw/index.php?title=MySQL_InnoDB_Foreign_Key_Error&amp;diff=667&amp;oldid=prev"/>
		<updated>2013-07-25T08:08:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 08:08, 25 July 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Chris</name></author>
		
	</entry>
	<entry>
		<id>https://deltanine.net/mw/index.php?title=MySQL_InnoDB_Foreign_Key_Error&amp;diff=666&amp;oldid=prev</id>
		<title>Chris at 09:35, 3 August 2009</title>
		<link rel="alternate" type="text/html" href="https://deltanine.net/mw/index.php?title=MySQL_InnoDB_Foreign_Key_Error&amp;diff=666&amp;oldid=prev"/>
		<updated>2009-08-03T09:35:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I was getting Error 1005 &amp;quot;can't create table&amp;quot; ... errno 150 when trying to create a foreign key using the following&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ALTER TABLE `user`&lt;br /&gt;
  ADD CONSTRAINT FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What I needed to do to fix it was to create an index on group_id in the user table. Also if you get error 1452 make sure you don't already have fields filled which would otherwise be invalid.&lt;br /&gt;
&lt;br /&gt;
==Delete a Foreign Key==&lt;br /&gt;
Get the Key Name from the bottom of an export, then&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ALTER TABLE page_titles DROP FOREIGN KEY 0_172&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
		
	</entry>
</feed>