Changing mysql Database Encoding to UTF8
- By default mysql uses latin1 encoding.
You can check the current encoding of your database as follows:
mysql -u virpi -p pim mysql> SHOW VARIABLES LIKE 'character_set_database'; +------------------------+--------+ | Variable_name | Value | +------------------------+--------+ | character_set_database | latin1 | +------------------------+--------+
To change the encoding to UTF8, run alter as follows:
alter database pim character set 'utf8'; mysql> show variables like "character_set_database"; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | character_set_database | utf8 | +------------------------+-------+ 1 row in set (0.00 sec)
