change default collation in phpmyadmin

For Linux:

  1. You need to have access to the MySQL config file.
    The location can vary from /etc/mysql/my.cnf to ~/my.cnf (user directory).

  2. Add the following lines in the section [mysqld]:

    collation_server = utf8_unicode_ci
    character_set_server=utf8
    
  3. Restart the server:

    service mysqld restart
    

This is not a phpMyAdmin question.

Collations are part of recent MySQL releases, you must set the default collation of the server (or at least of the database) to change that behaviour.

To convert already imported tables to UTF-8 you can do (in PHP):

$dbname = 'my_databaseName';
mysql_connect('127.0.0.1', 'root', '');
mysql_query("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
$res = mysql_query("SHOW TABLES FROM `$dbname`");
while($row = mysql_fetch_row($res)) {
   $query = "ALTER TABLE {$dbname}.`{$row[0]}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
   mysql_query($query);
   $query = "ALTER TABLE {$dbname}.`{$row[0]}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
   mysql_query($query);
}
echo 'all tables converted';

Code snippet taken from here.


For utf8mb4, add/change the following in the [mysqld] section:

collation_server = utf8mb4_unicode_ci
character_set_server = utf8mb4

Then restart the mysql service (for Ubuntu the command is sudo service mysql restart)


In your Mysql configuration change the default-character-set operative under the [mysqld] tab. For example:

[mysqld]
default-character-set=utf8

Don't forget to restart your Mysql server afterwards for the changes to take effect.