Database collations relate to how a database views and displays various language characters. For instance, an all English collation will not display accented characters in other languages well such as "?, ?, ?, etc". For the most part, all collations should always be the same. To tell what your particular server collations are you should look in phpmyadmin or ask your hosting.
Different servers may have different collations while some will have the same. When you install software on a server (such as SMF) or add mods, themes, etc. from within a program such as SMF they will be installed and set to whatever collation the default is for the server.
Problems arise if you change hosting or move to another server that does not have the same collations. A previous server you were on may have had "utf8_general_ci" as the default and the new server that you just moved to may be set to "latin1_swedish_ci".
Installing things on the old server will give you "utf8_general_ci" collations. But after the move anything you install, such as a mod, will give you "latin1_swedish_ci". When you view your database in phpmyadim you will see "mixed" collations some for one and some for the other. The more you change hostings and encounter different collations you will get even more mixed collations.
The point is: mixed collations can cause problems for your mods and you'll may never know why.
Here are 2 easy ways to fix this:
1. Use the following script by making the necessary changes described below and uploading it to the root folder of your forum:
<?php
$db = mysql_connect('localhost','myuser_mydbuser','mypassword');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('myuser_mydbname'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>
Make sure to substitute in the above script:
- myuser_mydbname with your database name;
- myuser_mydbuser with your mysql username;
- mypassword with your password for the mysql user;
- utf8-general_ci with your new collation if different;
2. Download:
Phoca Changing Collation Tool