To double check you have the correct utf8 settings try this:
- Login to mysql and run
mysql> show variables like 'char%';
The output should look like:
+--------------------------+---------------------------------+
| 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/local/mysql/share/charsets/|
+--------------------------+---------------------------------+
- Then run
mysql> show variables like 'collation%';
This should give you:
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_unicode_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+
If not edit your /etc/my.cnf
or /etc/mysql/my.cnf
if you an not find it just run sudo find / -name my.cnf
After you do find it do vim /etc/my.cnf
press i
to insert text and add
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
Feel free to comment out the previous/old [mysqld] block or lines.
Save the file by pressing esc
then type :wq
and press enter
- Restart mysql
service mysql restart
or service mysqld restart
Hope that helps.