Most info on the Net says to do the below. So I wanted to combine those into just 1 statement instead of 2.
init-connect='SET NAMES utf8' init_connect='SET CHARACTER SET=utf-8'
Combining init_connect
Add to your /etc/my.cnf
[mysqld] init_connect='SET collation_connection = utf8_general_ci,NAMES utf8' character-set-server = utf8 collation-server = utf8_general_ci
You can change the default server character set and collation with the --character-set-server and --collation-server options when you start the server. The collation must be a legal collation for the default character set.
my.cnf Definitions and Uses
- init-connect
- A string to be executed by the server for each client that connects. The string consists of one or more SQL statements, separated by semicolon characters. For example, each client session begins by default with autocommit mode enabled.
- default-character-set
- Use charset_name as the default character set for the client and connection. A common issue that can occur when the operating system uses utf8 or another multi-byte character set is that output from the mysql client is formatted incorrectly, due to the fact that the MySQL client uses the latin1 character set by default. You can usually fix such issues by using this option to force the client to use the system character set instead.
- character-set-client
- The character set for statements that arrive from the client. The session value of this variable is set using the character set requested by the client when the client connects to the server. The global value of the variable is used to set the session value in cases when the client-requested value is unknown or not available, or the server is configured to ignore client requests.
- character-set-system
- The character set used by the server for storing identifiers. The value is always utf8.
- character-set-server
- The server's default character set.
- collation-connection
- The collation of the connection character set.
- collation-server
More Info
You can find more information on the following manual pages:
- http://dev.mysql.com/doc/refman/5.6/en/charset-configuration.html
- http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_character_set_system
- http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_character_set_server
March 13th, 2013
« Awesome WireLess Bluetooth HeadsetDisqus 2012 Default Sort Order Fix »