mysql

Change a column which is or has a foreign key in MySQL

When trying to change(alter) a column which is a foreign or has a foreign in MySQL, an error info like below shows up:

Error
SQL query:
ALTER TABLE `city` CHANGE `CountryCode` `CountryCode` CHAR( 3 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
MySQL said:
#1025 - Error on rename of './test/#sql-82d_2cb' to './test/city' (errno: 150)

English
Subscribe to RSS - mysql