blog.dbrgn.ch

Change MySQL Database Encoding

written on Friday, June 18, 2010 by

To change MySQL table column encoding:

ALTER TABLE artists
CHANGE [fieldname] [fieldname] [fieldtype]
CHARACTER SET [encoding]
COLLATE [collation];

To change table encoding:

ALTER TABLE [tablename]
CONVERT TO CHARACTER SET [encoding]
COLLATE [collation];

To change database encoding:

ALTER DATABASE [dbname]
CHARACTER SET [encoding]
COLLATE [collation];

This entry was tagged databases