MySQL 8.0 fails to create user as part of GRANT ALL statement

This commit is contained in:
Ralf Becker 2019-07-10 09:17:39 +02:00
parent 1e23fca924
commit d1785a5340

View File

@ -1136,7 +1136,8 @@ class Db
$create .= ' DEFAULT CHARACTER SET '.$this->Link_ID->charset2mysql[$charset].';';
}
$sqls[] = $create;
$sqls[] = "GRANT ALL ON `$currentDatabase`.* TO $currentUser@'$grant_host' IDENTIFIED BY ".$this->quote($currentPassword);
$sqls[] = "CREATE USER $currentUser@'$grant_host' IDENTIFIED BY ".$this->quote($currentPassword);
$sqls[] = "GRANT ALL PRIVILEGES ON `$currentDatabase`.* TO $currentUser@'$grant_host'";
break;
default:
throw new Exception\WrongParameter(__METHOD__."(user=$adminname, \$pw) not yet implemented for DB-type '$this->Type'");