MySQL Character Encoding Issues
These MySQL commands might come in handy when running up against character encoding issues:
mysql> use `your_database`; Database changed mysql> show variables like "collation_database"; +--------------------+-----------------+ | Variable_name | Value | +--------------------+-----------------+ | collation_database | utf8_general_ci | +--------------------+-----------------+ 1 row in set (0.00 sec) mysql> show variables like "character_set_database"; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | character_set_database | utf8 | +------------------------+-------+ 1 row in set (0.00 sec) mysql> show create database `your_database`; +---------------+------------------------------------------------------------------------+ | Database | Create Database | +---------------+------------------------------------------------------------------------+ | your_database | CREATE DATABASE `your_database` /*!40100 DEFAULT CHARACTER SET utf8 */ | +---------------+------------------------------------------------------------------------+ 1 row in set (0.01 sec) mysql> show create table `your_table`; +------------+-----------------------------------------------------------------------------------------------------+ | Table | Create Table | +------------+-----------------------------------------------------------------------------------------------------+ | your_table | CREATE TABLE `your_table` ( `test` varchar(255) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | +------------+-----------------------------------------------------------------------------------------------------+ 1 row in set (0.02 sec)

Comments
Anonymous
Fri, 16/10/2009 - 09:35
Permalink
Looks handy!
Looks handy!
Add new comment