change default collation in phpmyadmin

后端 未结 8 775
野的像风
野的像风 2020-12-23 17:05

It seems to me that phpMyAdmin imports tables by default with collation latin1_swedish_ci, how i change this?

相关标签:
8条回答
  • 2020-12-23 17:19

    For Linux:

    1. You need to have access to the MySQL config file.
      The location can vary from /etc/mysql/my.cnf to ~/my.cnf (user directory).

    2. Add the following lines in the section [mysqld]:

      collation_server = utf8_unicode_ci
      character_set_server=utf8
      
    3. Restart the server:

      service mysqld restart
      
    0 讨论(0)
  • 2020-12-23 17:24

    I wanted to use utf8mb4 instead, and the configuration had to be the following:

    collation_server = utf8mb4_general_ci
    character_set_server=utf8mb4
    

    the server would not start if the character_set was set to utf8

    0 讨论(0)
  • 2020-12-23 17:25

    know this is an old post. But the way i changed the default charset through phpMyAdmin was:

    phpMyadmin main page > Variables tab (Server variables and settings) > searched for "character" and changed all variables from "latin1" to "utf8". (on a MAMP installation with phpMyAdmin v. 3.5.7)

    And as the others said, this is the variables for MySQL and not some phpMyAdmin specific ones.

    0 讨论(0)
  • 2020-12-23 17:30

    For utf8mb4, add/change the following in the [mysqld] section:

    collation_server = utf8mb4_unicode_ci
    character_set_server = utf8mb4
    

    Then restart the mysql service (for Ubuntu the command is sudo service mysql restart)

    0 讨论(0)
  • 2020-12-23 17:33

    In your Mysql configuration change the default-character-set operative under the [mysqld] tab. For example:

    [mysqld]
    default-character-set=utf8
    

    Don't forget to restart your Mysql server afterwards for the changes to take effect.

    0 讨论(0)
  • 2020-12-23 17:36
    1. Insert this strings into my.ini (or my.cnf)
    [mysqld]
    collation_server = utf8_unicode_ci
    character_set_server=utf8
    
    1. Add into config.inc.php
    $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
    
    1. You need to restart MySQL server and remove cookies,data for domain where is located PhpMyAdmin

    2. Reload page with PhpMyAmdin and at look the result

    0 讨论(0)
提交回复
热议问题