skip to Main Content

I’m trying to get the phpMyAdmin front page to show the "Server Charset" as "UTF-8 Unicode (utf8)". Currently, it is displaying as "cp1252 West European (latin1)".

Is there a config.inc.php setting that I need to change to do this? I initially assumed that it was a setting that needed to be changed on the MySQL database itself…but if you look at the screenshot I provided, you’ll see that on my hosting provider’s phpMyAdmin instance that connects to the exact same database, the Server charset is UTF-8. So this tells me that the Server charset value is somehow controlled by phpMyAdmin. It kind of makes sense too, because you can actually specify a charset when connecting to MySQL via a connection string with the "charset=utf8" option. I just don’t know where to specify that in phpMyAdmin.

enter image description here

3

Answers


  1. Add

    $cfg['DefaultCharset'] = 'utf8';
    $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
    

    To your config.inc.php, just look for the name of this file in your server directories. Then restart MySQL

    Login or Signup to reply.
  2. I had exactly the same problem, for some reason in my case I had to change it manually when working locally on my computer(I use xampp)I don’t know if it would work for you as I tried just a lot of different options when working locally but when I uploaded everything to a shared hosting, server charset was automatically set up to UTF-8 Unicode (utf8)and no set up was required, as well as you I had two instances of the same database but with a different server charset setting. Anyway here’s what I did.

    1 open file my.ini (xampp/mysql/bin/my.ini)
    2 add this before [client]

    [mysqld]
    

    character_set_server = utf8
    collation_server = utf8_general_ci

    save

    3 stop mysql and apache once, start them again.

    4 check if it worked.

    I know this question was asked 6 months ago but I didn’t find the answer that worked for me in here so I decided to share in the hope of helping anybody with the same problem.

    Login or Signup to reply.
  3. The answer from Undry is correct (phpMyAdmin v5.2.0)
    It’s a phpMyAdmin setting if you want the default for creating new databases to show utf8_general_ci.
    See phpMyAdmin docs https://docs.phpmyadmin.net/en/latest/config.html and
    https://docs.phpmyadmin.net/en/latest/config.html#cfg_DefaultConnectionCollation

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search