FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


convert the entire database's collation to utf8_general_ci





Mgccl
anyone got a query that can change every table and every field's collation that is latin1_swedish_ci to utf8_general_ci?
I have a lot tables and fields and I need to do it manually one by one in phpmyadmin, that could cost me like 3 days.


BTW it's mysql version 4.1

thanks in advance
vinx_18
TRY this:

ALTER TABLE `table_name` CHANGE `field_name` `field_name` TYPE CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL


Note:

Just copy and paste it.
Change the table_name to its corresponding correct table name.
Change the field_name to its corresponding correct field name.
Change the type to its corresponding type lke VARCHAR (20)..etc.
You may omit the NOT null at the last.
Also, you may run it in php script by a for loop or while loop...store all field names and table names in an array.

Smile
Related topics
Your favourite group/singer? *OFFICIAL*
A use for Ajax?
Search function
a game online
Sig display - only once.
problem with registration notify mod
Switching over to phpBB
if you are a guitarist , and want the best TABS....
CSS or XSL
Delete Users From phpBB
Help Needed ! Can anyone decode a .CDB file ??
I need help! MySQL version ploblem
Change database collation type
New Server - Database Tables Missing
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.