0

I try to change collation on MySQL table from latin1_swedish_ci to utf8_general_ci. I used query like this:

ALTER TABLE mytable
MODIFY myfield varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci;`

But this query result errno 150. I think this is because foreign key that reference into mytable. I try to delete all record on my database, I drop all foreign keys also. I try to run again. But still result errno 150.

Any idea about my problem ?

Thibault
  • 1,566
  • 15
  • 22
AdrianUsagi
  • 39
  • 1
  • 5
  • Do you have an error message in addition to the error code 150 ? Run again your `ALTER TABLE`, and once you have the error, run the command `show errors;`. – Thibault May 23 '14 at 08:32
  • Does this answer your question? [What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean?](https://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me) – miken32 Jul 14 '22 at 23:03

1 Answers1

0

This is not a COLLATION related error but a Foreign Key one.

Altering a table returns an error (errno: 150) if a foreign key definition is incorrectly formed for the altered table. Source

gtrudax
  • 1
  • 2
  • If the paragraph you have formatted as a block quote is actually quoting something, then you should provide a link to the source. – Adrian Mole Jul 12 '22 at 08:32