 <p>Assuming your constraint name in table <code>two</code> is <code>two_ibfk_1</code> , you can see the name of the constraint with this command :<br> SHOW CREATE TABLE <code>two</code>;</p> <p>so the command would be to delete the constraint first, and then recreate it after it was modified</p> <pre><code>ALTER TABLE two DROP FOREIGN KEY two_ibfk_1; ALTER TABLE one MODIFY COLUMN `id` int(10) NOT NULL auto_increment; ALTER TABLE two MODIFY COLUMN `one_id` int(10) NOT NULL ; ALTER TABLE two ADD CONSTRAINT FOREIGN KEY (`one_Id`) REFERENCES `one` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; </code></pre> <p>FYI, the second command to modify table <code>two</code> can not be set as auto_increment, because the primary is is column <code>id</code></p>