Character set of the file phpmyadmin
Unfortunately, phpMyAdmin is one of the first php application that talk to MySQL about charset correctly. Your problem is most likely due to the fact that the database does not store the correct UTF-8 strings at first place. Show In order to correctly display the characters correctly in phpMyAdmin, the data must be correctly stored in the database. However, convert the database into correct charset often breaks web apps that does not aware charset-related feature provided by MySQL. May I ask: is MySQL > version 4.1? What web app is the database for? phpBB? Was the database migrated from an older version of the web app, or an older version of MySQL? My suggestion is not to brother if the web app you are using is too old and not supported. Only convert database to real UTF-8 if you are sure the web app can read them correctly. Edit: Your MySQL is > 4.1, that means it's charset-aware. What's the charset
collation settings for you database? I am pretty sure you are using For charset-insensitive clients (i.e. mysql-cli and php-mod-mysql), characters get displayed correctly since they are being transfer to/from database as bytes. In phpMyAdmin, bytes get read and displayed as ASCII characters, that's the garbage text you seem. Countless hours had been spend years ago (2005?) when MySQL 4.0 went obsolete, in many parts of Asia. There is a standard way to deal with your problem and gobbled data:
For more information about charset on MySQL, please refer to manual: http://dev.mysql.com/doc/refman/5.0/en/charset-server.html Note that I assume your web app is
using php-mod-mysql to connect to the database (hence the phpMyAdmin use php-mod-mysqli to connect to MySQL. I never learned how to use it because switch to frameworks* to develop my php projects. I strongly encourage you do that too.
OverviewThe default character set for MySQL at (mt) Media Temple is latin1, with a default collation of latin1_swedish_ci. This is a common type of encoding for Latin characters. You can also change the encoding. utf8 is a common character set for non-Latin characters. NOTE: Advanced Support can help! Changing database character set and collationYou can change the character set and collation of your databases and tables through phpMyAdmin or from the command line. You may want to back up your database before making changes. Please see this article for instructions: Export and import MySQL databases. phpMyAdmin
Command Line
For more information about database collation, please read the MySQL documentation: http://dev.mysql.com/doc/refman/5.0/en/charset-database.html Available character setsThe following character sets are available:
How do I change the character set in phpMyAdmin?Changing database character set and collation. Log into phpMyAdmin.. Select your database from the list on the left.. Click on "Operations" from the top set of tabs.. In the Collation box, choose your new collation from the dropdown menu. ... . Select your database from the list on the left.. What is character set in MySQL?The default MySQL server character set and collation are utf8mb4 and utf8mb4_0900_ai_ci , but you can specify character sets at the server, database, table, column, and string literal levels.
How do I find the character set of a MySQL database?To see the default character set and collation for a given database, use these statements: USE db_name; SELECT @@character_set_database, @@collation_database; Alternatively, to display the values without changing the default database: SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.
What is character set utf8mb4?utf8mb4 : A UTF-8 encoding of the Unicode character set using one to four bytes per character. utf8mb3 : A UTF-8 encoding of the Unicode character set using one to three bytes per character. This character set is deprecated in MySQL 8.0, and you should use utfmb4 instead.
|