Changing the Database Collation in PhpMyAdmin

Posted on April 23rd, 2018

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.

 

 

6 Responses to “Changing the Database Collation in PhpMyAdmin”

  1. devesh says:

    If you have an existing plan with us, please open a ticket with our support department: https://www.interserver.net/contact-information.html

  2. Larous says:

    Thank You sir. It helped me alot

  3. Gebru Gidey says:

    i need to convert my cpanel database to set utf8mb4_unicode_ci before importing, but it can’t work to me, please try to help me?

    • Enya Ribba says:

      Just open your database file with NOTEPAD or NOTEPAD++ for Windows and Modify those parameters…

      for my example:

      CREATE DATABASE IF NOT EXISTS `zenuxmsc_foroenigma` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

  4. Hamza Altaf says:

    I want My database to accept String like Hamza and generate error when enter an integer value what is best collation and type for that.
    Kindly Reply me as soon as possible 🙂

Leave a Reply