I have set up the Collation of all my database tables as latin1_swedish_ci
and now I realise that I should use utf8_bin
or utf8_general_ci
.
How can I change the Collation in the tables to utf8_bin
or utf8_general_ci
in one go? Can I use a query or something?
You'll simply need to run an ALTER on each of the tables as follows:
If you also need to update the existing character encoding (unlikely by the sounds of things), you can use:
Here are two ways. First one worked for me. From the terminal (Just remember to backup before.)
Source: Commandlineinfu.com
From MySQL you will have to use the Concat command
You can also update the database collation with:
You can change the collation of a table with
ALTER TABLE
: