From a2a03c3f70a519381074e545d9ff9d742d6c2df1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 16 Apr 2017 16:04:38 +0200 Subject: [PATCH] Default UTF8MB4 for CREATE DATABASE --- friendica_test_data.sql | 2 +- mod/install.php | 2 +- util/vagrant_provision.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/friendica_test_data.sql b/friendica_test_data.sql index 6a34272bb6..f3a0081384 100644 --- a/friendica_test_data.sql +++ b/friendica_test_data.sql @@ -19,7 +19,7 @@ -- Current Database: `friendica` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `friendica` /*!40100 DEFAULT CHARACTER SET latin1 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `friendica` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */; USE `friendica`; diff --git a/mod/install.php b/mod/install.php index fbd296a9da..8854723b76 100755 --- a/mod/install.php +++ b/mod/install.php @@ -48,7 +48,7 @@ function install_post(App $a) { $db = new dba($dbhost, $dbuser, $dbpass, '', true); if(! get_db_errno()) { - $r = q("CREATE DATABASE '%s'", + $r = q("CREATE DATABASE '%s' DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci", dbesc($dbdata) ); if ($r) { diff --git a/util/vagrant_provision.sh b/util/vagrant_provision.sh index 6b7f0b862e..39db0d73c4 100644 --- a/util/vagrant_provision.sh +++ b/util/vagrant_provision.sh @@ -100,7 +100,7 @@ sudo ln -fs /vagrant /var/www cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php # create the friendica database -echo "create database friendica" | mysql -u root -proot +echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | mysql -u root -proot # import test database $MYSQL -uroot -proot friendica < /vagrant/friendica_test_data.sql -- 2.39.5