# HG changeset patch # User Mads Kiilerich # Date 1452007811 -3600 # Node ID 6353b5e870917c09cfd07fe569d428a92a12d0d7 # Parent 82ed7ad0dc480a8e8fc102edb008bdad68862be0 ini: specify utf8 for sample MySQL connection strings By default, the MySQL stack will store unicode as UTF-8 encoded data in string fields, thus without using any unicode capabilities in the database. As described in http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql-unicode , set charset=utf8 to actually put unicode in the database. Existing databases that already store utf8 in the database should keep using the old url. This will only support 16 bit code points, but utf8mb4 will double the key size and make them too big for MySQL. diff -r 82ed7ad0dc48 -r 6353b5e87091 development.ini --- a/development.ini Tue Jan 05 16:30:05 2016 +0100 +++ b/development.ini Tue Jan 05 16:30:11 2016 +0100 @@ -493,7 +493,7 @@ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others diff -r 82ed7ad0dc48 -r 6353b5e87091 kallithea/bin/template.ini.mako --- a/kallithea/bin/template.ini.mako Tue Jan 05 16:30:05 2016 +0100 +++ b/kallithea/bin/template.ini.mako Tue Jan 05 16:30:11 2016 +0100 @@ -495,7 +495,7 @@ %elif database_engine == 'mysql': # MySQL -sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 %endif # see sqlalchemy docs for others diff -r 82ed7ad0dc48 -r 6353b5e87091 kallithea/config/deployment.ini_tmpl --- a/kallithea/config/deployment.ini_tmpl Tue Jan 05 16:30:05 2016 +0100 +++ b/kallithea/config/deployment.ini_tmpl Tue Jan 05 16:30:11 2016 +0100 @@ -485,7 +485,7 @@ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others diff -r 82ed7ad0dc48 -r 6353b5e87091 kallithea/tests/test.ini --- a/kallithea/tests/test.ini Tue Jan 05 16:30:05 2016 +0100 +++ b/kallithea/tests/test.ini Tue Jan 05 16:30:11 2016 +0100 @@ -495,7 +495,7 @@ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others