A lot of people, upgrading from 4.6 to 4.7, or having phpmyadmin issues, are interested in a script or some sort of file that will change the collation to utf8_general_ci on all tables. Anyone have any ideas? I want to add it to the handbook.
I think it would be pretty easy to make a sql thingy for default tables, how do you deal with prefixes?
Anisa. OOO! How about a list of tablenames in the handbook...
Ni Anisa, I'm not a MySQL-Guru, but you may use something like the following in a simple PHP enabled Drupal page:
<?php global $db_url; $database = parse_url($db_url); $result = db_query('show tables'); while($tables = db_fetch_array($result)) { foreach ($tables as $key => $value) { db_queryd("ALTER TABLE %s COLLATE utf8_general_ci",$value); } } ?>
vg
Am Dienstag, 27. Juni 2006 16:53 schrieb Anisa:
A lot of people, upgrading from 4.6 to 4.7, or having phpmyadmin issues, are interested in a script or some sort of file that will change the collation to utf8_general_ci on all tables. Anyone have any ideas? I want to add it to the handbook.
I think it would be pretty easy to make a sql thingy for default tables, how do you deal with prefixes?
Anisa. OOO! How about a list of tablenames in the handbook...
Thank you for your reply!
I'm a little scared of 'handmade' database-altering php scripts.
This will change the collation for ALL tables, right?
I made up a list of table names for 4.7 and am attaching them to this e-mail. Maybe someone will find it useful!
Anisa.
On 6/28/06, Sanduhrs sanduhrs@audiens.de wrote:
Ni Anisa, I'm not a MySQL-Guru, but you may use something like the following in a simple PHP enabled Drupal page:
<?php global $db_url; $database = parse_url($db_url); $result = db_query('show tables'); while($tables = db_fetch_array($result)) { foreach ($tables as $key => $value) { db_queryd("ALTER TABLE %s COLLATE utf8_general_ci",$value); } } ?>
vg
Am Dienstag, 27. Juni 2006 16:53 schrieb Anisa:
A lot of people, upgrading from 4.6 to 4.7, or having phpmyadmin issues, are interested in a script or some sort of file that will change the collation to utf8_general_ci on all tables. Anyone have any ideas? I
want
to add it to the handbook.
I think it would be pretty easy to make a sql thingy for default tables, how do you deal with prefixes?
Anisa. OOO! How about a list of tablenames in the handbook...
-- [ Drupal support list | http://lists.drupal.org/ ]
On 6/27/06, Anisa mystavash@animecards.org wrote:
I'm a little scared of 'handmade' database-altering php scripts.
Reasonably so...
I made up a list of table names for 4.7 and am attaching them to this e-mail. Maybe someone will find it useful!
Well, this is nice for your situation, but for others who have custom tables (e.g. for extra modules) it is not as useful handy. In that case, it´s better to use a custom script...Speaking of, I haven´t tested the script provided by Sanduhrs but it appears like it would work - though it may be mysql only... (is "show tables" cross database?)
Regards, Greg
Anisa wrote:
A lot of people, upgrading from 4.6 to 4.7, or having phpmyadmin issues, are interested in a script or some sort of file that will change the collation to utf8_general_ci on all tables. Anyone have any ideas? I want to add it to the handbook.
I think it would be pretty easy to make a sql thingy for default tables, how do you deal with prefixes?
Are you still interested in such a script? I did one for myself when migrating from 4.6 to 4.7 and it does not care about table names or prefixes - converts anything. (CC me directly, I don't read the list too often)