Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Use uft8mb4 to support 4-byte unicode characters #6197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ password=$OPENSHIFT_MYSQL_DB_PASSWORD
# TODO: Should be we running mysql_secure_installation

echo "drop database test;
create database \`${dbname}\` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" | mysql_context "/usr/bin/mysql -u root -S '$socket_file'" > /dev/null || error 'Failed to create database' 188
create database \`${dbname}\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;" | mysql_context "/usr/bin/mysql -u root -S '$socket_file'" > /dev/null || error 'Failed to create database' 188

echo "
delete from user;
Expand Down
11 changes: 11 additions & 0 deletions cartridges/openshift-origin-cartridge-mysql/conf/my.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
# max_connections -> OPENSHIFT_MYSQL_MAX_CONNECTIONS
# ft_min_word_len -> OPENSHIFT_MYSQL_FT_MIN_WORD_LEN
# ft_max_word_len -> OPENSHIFT_MYSQL_FT_MAX_WORD_LEN
# default-character-set -> OPENSHIFT_MYSQL_DEFAULT_CHARACTER_SET
# character-set-server -> OPENSHIFT_MYSQL_CHARACTER_SET_SERVER
# collation-server -> OPENSHIFT_MYSQL_COLLATION_SERVER
# character-set-client-handshake -> OPENSHIFT_MYSQL_CHARACTER_SET_CLIENT_HANDSHAKE

[client]
default-character-set = <%= ENV['OPENSHIFT_MYSQL_DEFAULT_CHARACTER_SET'] ? ENV['OPENSHIFT_MYSQL_DEFAULT_CHARACTER_SET'] : 'utf8mb4' %>

[mysqld]
character-set-server = <%= ENV['OPENSHIFT_MYSQL_CHARACTER_SET_SERVER'] ? ENV['OPENSHIFT_MYSQL_CHARACTER_SET_SERVER'] : 'utf8mb4' %>
collation-server = <%= ENV['OPENSHIFT_MYSQL_COLLATION_SERVER'] ? ENV['OPENSHIFT_MYSQL_COLLATION_SERVER'] : 'utf8mb4_unicode_ci' %>
character-set-client-handshake = <%= ENV['OPENSHIFT_MYSQL_CHARACTER_SET_CLIENT_HANDSHAKE'] ? ENV['OPENSHIFT_MYSQL_CHARACTER_SET_CLIENT_HANDSHAKE'] : 'TRUE' %>
datadir=<%= ENV['OPENSHIFT_MYSQL_DIR'] %>data/
socket=<%= ENV['OPENSHIFT_MYSQL_DB_SOCKET'] %>
# Disable reverse DNS resolving of gear ip BZ#1051348
Expand Down Expand Up @@ -61,6 +71,7 @@ max_allowed_packet = 16M

[mysql]
no-auto-rehash
default-character-set = <%= ENV['OPENSHIFT_MYSQL_DEFAULT_CHARACTER_SET'] ? ENV['OPENSHIFT_MYSQL_DEFAULT_CHARACTER_SET'] : 'utf8mb4' %>
# Remove the next comment character if you are not familiar with SQL
#safe-updates

Expand Down