Skip to content

Commit

Permalink
Merge pull request #128 from abg/feature/handle_mysql57
Browse files Browse the repository at this point in the history
Support mysql 5.7
  • Loading branch information
abg committed Mar 20, 2017
2 parents 4d79c61 + e8d8e6f commit 9c76a00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
History
=======

2.1.3 (unreleased)
------------------

Bugs fixed

* sandbox now handles MySQL 5.7 instance bootstrapping (PR #128)

2.1.2 (2017-02-15)
------------------

Expand Down
6 changes: 6 additions & 0 deletions dbsake/core/mysql/sandbox/templates/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ CREATE DATABASE IF NOT EXISTS `test`;
-- dbsake: cleanup system users start --
DELETE FROM `user` WHERE Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM `user` WHERE User = '';
{# MySQL 5.7.6 removed the mysql.user (Password) column
MySQL 5.7.2 requires plugin to be populated #}
{% if distribution.version.tag != "MariaDB" and distribution.version >= (5, 7) %}
UPDATE `user` SET plugin = 'mysql_native_password', authentication_string = CONCAT('*', UPPER(SHA1(UNHEX(SHA1('{{password|escape_string}}'))))) WHERE user = 'root';
{% else %}
UPDATE `user` SET PASSWORD = PASSWORD('{{password|escape_string}}') WHERE User = 'root';
{% endif %}
DELETE FROM `db` WHERE (Db = 'test' OR Db = 'test\_%') AND User = '';
-- dbsake: cleanup system users end --
{% endif %}

0 comments on commit 9c76a00

Please sign in to comment.