The Answer to Life, the Universe, and Everything

Friday, January 11, 2008

MySQL5 character set

All you need to edit my.cnf in order not to write the command like "set name xxx" everytime you restart the service.


[client]
default-character-set = utf8

[mysqld]
skip-character-set-client-handshake
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8

[mysqldump]
default-character-set = utf8

[mysql]
default-character-set = utf8


In order to check the charset

mysql> shwo variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

#Then set charset
mysql>set character_set_database=utf8
mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+


30 comments:

Anonymous said...

You save my LIFEEEEE !!!!

Anonymous said...

You, sir, are a legend.

Anonymous said...

You save my LIFEEEEE !!!!

and

You, sir, are a legend.

Anonymous said...

i honestly enjoy all your writing choice, very charming,
don't give up as well as keep creating since it just well worth to look through it,
excited to browse through more of your own content articles, enjoy your day!

Anonymous said...

italy breakfast booking
[url=http://vimeo.com/user4498961]hotel price compare
[/url]plane presence
second-rate ill fame in the direction of convey title
satisfaction
[url=http://www.earthday.org/users/48490]cheap rates for hotels
[/url]matrix min hotel deals
european breakfast booking
hotels motels
[url=http://www.fairview.org/cty/members/klemot/default.aspx]meridional hotel
[/url]jal frugality class
thai airways restraint classification
aqui es motor hotel
[url=http://www.youthcabinet.org/profile/Josh]hotel price bot
[/url]oldest merit feeling excursions
what is premium thrift kind
guest-house deals april
[url=http://www.beautyresearch.com/blogs/alexa/archive/2010/08/15/hotels-and-accomodations.aspx]near hotel
[/url]online hotel reservation
economical breakfast
tuppence bangkok hotels
[url=http://www.mazdacommunity.com/profiles/blogs/special-hotel-offers-or]pod hotel
[/url]fair b & b deals
economy legislature slippers
the weekend michael gray download

Anonymous said...

payday loans online http://www.2applyforcash.com/ Eraxy Payday Loans unenteecheveash [url=http://www.2applyforcash.com/]Payday Loans[/url] payday loans online If you are brand-new in the game of internet marketing and desire to information to online browsers through these forums.

Anonymous said...

sildenafil without prescription viagra online natural - can you buy viagra online australia

Anonymous said...

http://westcoasttrading.com/content/empower-network-streetlight-ietting-filipinos Eraxy [url=http://www.boattripsonline.com/content/nova-empower-network-educate]making money online[/url] unenteecheveash business to start under 1000

Anonymous said...

buy viagra online viagra online without prescription- free shipping - buy viagra at cvs

Anonymous said...

viagra 50mg viagra online reviews - viagra online order

Anonymous said...

soma pain soma drug - soma shop jaipur

Anonymous said...

buy soma buy soma online fedex - beach house soma san diego

Anonymous said...

buy soma soma online paypal - soma drug opiate

Anonymous said...

order soma online soma bras ebay - soma rx online

Anonymous said...

buy soma many 350 mg soma should take - buy soma online no prescription cheap

Anonymous said...

buy tramadol in florida tramadol for dogs pet meds - tramadol 99 free shipping

Anonymous said...

buy tramadol next day tramadol questions - tramadol hcl 319

Anonymous said...

buy tramadol overnight shipping tramadol hcl usp - buy tramadol cheapest

Anonymous said...

generic xanax xanax overdose while pregnant - xanax bars

Anonymous said...

xanax cost fake xanax pills - generic xanax vs brand name xanax

Anonymous said...

carisoprodol buy carisoprodol bluelight - carisoprodol tablets usp 350 mg

Anonymous said...

generic xanax xanax online australia - xanax dosage 1mg

Anonymous said...

best buy tramadol tramadol 50 mg side effects for dogs - tramadol no prescription overnight delivery

Anonymous said...

buy cialis cheap cialis online united states - cialis daily experiences

Anonymous said...

xanax online xanax drug food interactions - maximum xanax dosage per day

Anonymous said...

buy cialis online buying cialis online usa - cialis daily or 36

Anonymous said...

http://landvoicelearning.com/#63987 tramadol hcl 50mg dosage - tramadol for dogs human use

Anonymous said...

buy lorazepam online ativan side effects weight loss - ativan addiction elderly

Anonymous said...

carisoprodol 350 mg carisoprodol overdose mg - carisoprodol soma watson 350 mg

Anonymous said...

buy carisoprodol c o d carisoprodol 350 mg forum - carisoprodol 350 mg overnight