MariaDB 10.1 needs CREATE USER before GRANT on restore

Version 1.5

Bugfix
Finished

When a DB is restored, previously the GRANT command was sufficient to create a new User, but with MariaDB 10.1, we noticed a behavior where this was not the case, eg: GRANT ALL PRIVILEGES ON `mysqlrest_test`.* TO 'mysqlrest'@localhost resulted in: #1133 - Can't find any matching row in the user table Solution was simply to call: CREATE USER 'mysqlrest'@localhost immediately prior to the GRANT. The password is set very shortly after that. Found to be caused by change in MariaDB 10.1 where they changed the default to use: NO_AUTO_CREATE_USER Related: https://mariadb.com/kb/en/mariadb/sql_mode/

Interested to try DirectAdmin? Get a 30-day Free Trial!