Skip to content

Instantly share code, notes, and snippets.

@thangnc
Last active December 16, 2015 09:33
Show Gist options
  • Save thangnc/691d4a4479ed82a4d7b8 to your computer and use it in GitHub Desktop.
Save thangnc/691d4a4479ed82a4d7b8 to your computer and use it in GitHub Desktop.
Setup Tomcat7 and MySQL UTF-8

Setup tomcat7 and enable UTF-8 on MySQL

Enable tomcat7

sudo ln -s /var/lib/tomcat7/conf /usr/share/tomcat6/conf
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy /usr/share/tomcat7/conf/catalina.policy
sudo ln -s /var/log/tomcat7 /usr/share/tomcat7/log
sudo chmod -R 777 /usr/share/tomcat7/conf

UTF-8 for MySQL

[client]
...
default-character-set = utf8

[mysqld]
...
character-set-server=utf8
collation-server=utf8_unicode_ci
init_connect='set collation_connection = utf8_unicode_ci;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment