Some more information:
On my Mac, when I try to set up XWiki with MySQL, I ran the following:
# Install mysql and start
brew update
brew install mysql
mysql.server start
# Now I can connect as "mysql -uroot"
# Create a new MySQL database for XWiki
# see
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL
mysql -u root -e "create database xwiki default character set utf8mb4
collate utf8mb4_unicode_ci"
mysql -u root -e "grant all privileges on *.* to xwiki@localhost
identified by 'xwiki'"
# Configure hibernate.cfg.xml
# This is only the mysql section
<property
name="connection.url">jdbc:mysql://localhost/xwiki</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property
name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property
name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">UTF-8</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
Now when I start XWiki, I get the error:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Row size too large. The maximum row size for the used table type, not
counting BLOBs, is 65535. This includes storage overhead, check the manual.
You have to change some columns to TEXT or BLOBs
It looks like whatever creates the XWiki tables is not handling utf8mb4
(see also
https://mathiasbynens.be/notes/mysql-utf8mb4 ).
On Wed, Apr 6, 2016 at 5:17 PM, Debajit Adhikary <debajit.work(a)gmail.com>
wrote:
I have an XWiki installation, and I noticed that
emoji's were not getting
saved correctly and were rendering as question marks in XWiki. This is
caused by MySQL's default encoding which is "utf8" and not
"utf8mb4"
(4-byte UTF to store the full unicode character set)
To fix this, I am in the process of converting all my MySQL database
tables into utf8mb4 encoding, which is turning out to be quite a lot of
manual work.
When XWiki creates the database tables for MySQL, can it use utf8mb4
encoding by default? Is this something I could open a bug request for?