Changing the Database Collation in PhpMyAdmin

Changing the Database Collation in PhpMyAdmin

A collation is a set of rules that defines how to compare and sort character strings. Every character set has at least one collation. The default character set for MySQL is latin1, with a default database collation of latin1_swedish_ci. You can also change the encoding to utf8 which is a is a common character set for non-Latin characters. The most common case is to change your MySQL collation from latin1 to utf8. This can be done by using phpMyAdmin and the steps are given below:

 

1) Login to your cPanel.

2) Navigate to Databases > PhpMyAdmin.

Database Collation

 

3) Select the database.

Database Collation

 

4) Click on “Operations” from the top set of tabs.

Database Collation

 

5) In the Collation box, choose your new collation from the drop-down menu. utf8_general_ci is the most common utf8 collation.

Database Collation

 

 

6) Then click the button “Go”.

Database Collation

 

 

You can also change the settings via command line:

1) Log into MySQL with SSH:

# mysql -u admin -p password

2) Enter your database password when prompted.

3) Run the following command to change the character set and collation of your database:

# ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;

 

If you need any further help please do reach our support department.