[SOLVED][Drupal Errors] User warning: Illegal mix of collations (PDOException: SQLSTATE[HY000]: General error: 1267)

| | 1 min read

Many Drupal programmers, Drupal site admins and Drupal site users have encountered errors similar to "User warning: Illegal mix of collations (PDOException: SQLSTATE[HY000]: General error: 1267)" in their Drupal site. If you are facing the same situation in your Drupal site then read on to find out more.

Follow the steps below to solve the error.

  • Create a PHP file on the server
  • Copy the following code into it
     $value) {
    mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
    }}
    echo "The collation of your database has been successfully changed!";
    ?>
  • Make sure to replace the placeholders with the appropriate values
  • Save and run the script

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.