欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

phpmysql error - #1273 - #1273 - Unknown collation: 'utf8mb4_general_ci' 有大用

要删除 cookie You can fix this issue by deleting browser cookie from the begining of time. I have tried this and it is working fine for me.

I have just installed PhpMyAdmin v4.1.5 English only

I have set it up to access 2 servers - the local one on my PC and the remote one on my server

All is fine for my local PC but when I log in to my remote server I get the message

Error

MySQL said:

#1273 - Unknown collation: 'utf8mb4_general_ci'

Searching the PhpMyAdmin code finds one reference to this in DatabaseInterface.class.php

        if (PMA_MYSQL_INT_VERSION >  50503) {
            $default_charset = 'utf8mb4';
            $default_collation = 'utf8mb4_general_ci';
        } else {
            $default_charset = 'utf8';
            $default_collation = 'utf8_general_ci';
        }

No idea what this is but it seems to be setting the default charset & collation wrongly

shareimprove this questionedited Jan 17 '14 at 16:12Rocket Hazmat149k24223274asked Jan 17 '14 at 16:10Trevor Wood126124

   Does the local machine run Windows? – Lars Beck Jan 17 '14 at 16:15   I am facing the same issue with linux. – dknight Jan 18 '14 at 11:28   I am having the same issue, but only in Firefox. Using Chrome works fine. Strange right? – Louis W Jan 28 '14 at 16:53   yes that code is causing the issue. If I remove the if else condition and have just the code which is inside the else condition it works fine. – Virendra Mar 18 '14 at 19:05   Here is the link to the issue in tracker: sourceforge.net/p/phpmyadmin/bugs/4236 – Virendra Mar 18 '14 at 19:14

This solution worked for me

1) Click the "Export" tab for the database

2) Click the "Custom" radio button

3) Go the section titled "Format-specific options" and change the dropdown for "Database system or older MySQL server to maximize output compatibility with:" from NONE to MYSQL40.

4) Scroll to the bottom and click "GO".

If it's related to wordpress, more info on why it is happening.

shareimprove this answeranswered May 15 '15 at 21:38shaunsantacruz6,42531318

   Thanks, worked for me and was really easy. – Julian May 26 '15 at 2:15   Perfect! Many thanks – Djouuuuh Jun 5 '15 at 8:12   Worked for me too - Thanks :) – Palak Tanejaa Jul 17 '15 at 10:55   Great solution. It helped me a lot. – Engr Arefin Sep 24 '15 at 16:32   Thanks worked for me! – Jestin Oct 20 '15 at 4:46

You can fix this issue by deleting browser cookie from the begining of time. I have tried this and it is working fine for me.

To delete only cookies:

  1. hold down ctrl+shift+delete

  2. remove all check boxes except for cookies of course

  3. use the drop down on top to select "from the beginning of time

  4. click clear browsing data

shareimprove this answeredited Feb 2 '16 at 0:43davejal3,58572150answered Feb 10 '15 at 11:47Anurag Srivastava24123

There are two steps to fix this.

First edit phpMyAdmin/libraries/DatabaseInterface.class.php

Change:

    if (PMA_MYSQL_INT_VERSION >  50503) {
        $default_charset = 'utf8mb4';
        $default_collation = 'utf8mb4_general_ci';
    } else {
        $default_charset = 'utf8';
        $default_collation = 'utf8_general_ci';
    }

To:

    //if (PMA_MYSQL_INT_VERSION >  50503) {
    //    $default_charset = 'utf8mb4';
    //    $default_collation = 'utf8mb4_general_ci';
    //} else {
        $default_charset = 'utf8';
        $default_collation = 'utf8_general_ci';
    //}

Then delete this cookie from your browser "pma_collation_connection".
Or delete all Cookies.

Then restart your phpMyAdmin.

(It would be nice if phpMyAdmin allowed you to set the charset and collation per server in the config.inc.php)

shareimprove this answeranswered Jun 19 '14 at 4:04GGedde32924

3 Deleting the pma_collation_connection already made the error go away for me! – Protector one Dec 5 '14 at 9:552 Thanks Worked me .. Deleting Cookie is Essential .. – Ravi Mehta Jan 15 '15 at 8:46

When you export you use the compatibility system set to MYSQL40. Worked for me.

shareimprove this answeredited Apr 24 '15 at 18:52HaveNoDisplayName6,092132236answered Apr 24 '15 at 18:29Thomas Gudin412

I had read yesterday that the issue was fixed for someone when that person cleared cookies. I had tried that but it did not work for me.

Checking the following section in DatabaseInterface.class.php,

        define(
            'PMA_MYSQL_INT_VERSION',
            PMA_Util::cacheGet('PMA_MYSQL_INT_VERSION', true)
        );

I figured that somehow cache is the problem. So, I remembered that I was restarting the service instead of doing a start and stop.

# restart the servicesystemd restart php-fpm# start and stop the servicesystemd stop php-fpm
systemd start php-fpm

Doing a stop followed by a start fixed the issue for me.

shareimprove this answeranswered Jan 18 '14 at 12:24dknight558317

   for the record clearing the cookie did worked for me – FR STAR Jan 19 '16 at 5:16

Is your MySQL server version 5.5.3 or greater?

The utf8mb4, utf16, and utf32 character sets were added in MySQL 5.5.3.

http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-sets.html

shareimprove this answeranswered Jan 17 '14 at 16:26Tan Hong Tat4,08811320

   I am having the issue but the server is at 5.0.x. – dknight Jan 18 '14 at 11:36   5.1.x, 5.0.x and below do not have the utf8mb4, utf16 and utf32 character sets. – Tan Hong Tat Jan 19 '14 at 13:44

protected by Community Jul 9 '15 at 14:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count). 

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged    or ask your own question.

来自 https://stackoverflow.com/questions/21190523/phpmysql-error-1273-1273-unknown-collation-utf8mb4-gene...

普通分类: