5

I am trying to use phpMyAdmin to access a remote MySQL database so I created a config.inc.php file (copying config.sample.inc.php) and added a server. Now this other server appear as an option in the login page but when connecting I receive this error: MySQL said #1115 - Unknown character set: 'utf8mb4'. Is there a workaround? Is there a configuration I can set? Any help highly appreciated.

slacktracer
  • 6,262
  • 6
  • 28
  • 33
  • possible duplicate of [ERROR 1115 (42000) : Unknown character set: 'utf8mb4' in mysql](http://stackoverflow.com/questions/21911733/error-1115-42000-unknown-character-set-utf8mb4-in-mysql) – T.Todua Jun 05 '14 at 07:37

9 Answers9

8

OPEN

C:\wamp\apps\phpmyadmin4.1.14\libraries\DatabaseInterface.class.php

search for 'utf8mb4' and replace it with 'utf8' in two consecutive lines like below

 $default_charset = 'utf8';
 $default_collation = 'utf8_general_ci';
Horaciux
  • 6,322
  • 2
  • 22
  • 41
RAHUL BHOLA
  • 81
  • 1
  • 1
7

Edit the following files:

<install path>/libraries/DatabaseInterface.class.php
<install path>/libraries/mysql_charsets.lib.php

And change all instances of 'utf8mb4' to 'utf8'.

It seems to have worked for me.

Shane
  • 827
  • 8
  • 18
3

If you've already edited the lines in the files mentioned in RAHUL-BHOLA and Shane's answers:

<install path>/libraries/DatabaseInterface.class.php
<install path>/libraries/mysql_charsets.lib.php

And are still getting this error, and you're exporting a database from one phpMyAdmin installation to another phpMyAdmin installation, you can fix the error by deleting the following line in the .sql export file:

/*!40101 SET NAMES utf8mb4 */;
Community
  • 1
  • 1
stephenspann
  • 1,823
  • 1
  • 16
  • 31
3

If you want to force export as well. You must edit file:

<install path>/libraries/plugins/export/ExportSql.class.php

and comment out following (from line 740) :

if ($set_names == 'utf8' && PMA_MYSQL_INT_VERSION > 50503) {
    $set_names = 'utf8mb4';
}

This will force export in SQL to be what you want to be. But you must first do changes in files (as was mentioned before)

<install path>/libraries/DatabaseInterface.class.php
<install path>/libraries/mysql_charsets.lib.php

New forced encoding in phpmyadmin is a pain in ass, because not all web hosting do recent updates. Such a stupid design!

meshosk
  • 86
  • 2
2

There is an incompatibility with phpMyAdmin 4.1.x and MySQL <= 5.5

Install phpMyAdmin 4.0.x

Ryan White
  • 1,927
  • 2
  • 19
  • 32
2

I found that changing a portion of code located in files such as:

<install path>/libraries/DatabaseInterface.class.php <install path>/libraries/plugins/export/ExportSql.class.php

from

PMA_MYSQL_INT_VERSION > 50503

to

PMA_MYSQL_INT_VERSION > 55503

does the trick

marcus
  • 136
  • 6
1

Use firefox, if You can live with that.

I got this error on only one database with Chrome. Firefox worked fine. Chrome even worked fine with a master/master replika of the faled database.

The edit in DatabaseInterface.class.php mentioned above solved the issue for Chrome.

Kjeld Flarup
  • 1,471
  • 10
  • 15
0

I have update the sql file that I exported by replacing
utf8mb4' to 'utf8'.
It worked for me. It happens due to improper mysql version.

Mukul Aggarwal
  • 1,515
  • 20
  • 16
0

Change at the time of export the old database: Database system or older MySQL server to maximize output compatibility with ->mysql 4

thats it