Home » Uncategorized » Change mysql schema and table collation

Change mysql schema and table collation

I was working performancing the Mysql DB and realized that some of my tables needed to be changed to UTF 8 from Latin. Here is the quick script to changing the Mysql schemas and Mysql table.

 ALTER DATABASE `Database_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci 
 ALTER TABLE `table_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci 

Just by changing the Schema does not changes all the tables in it. Individual tables need to be change. All the table, until explicitly told, will be made in the new collation / character set.

[category Mysql, DbAdmin]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s