Skip to content
Open
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
3 changes: 1 addition & 2 deletions lib/Drush/Sql/Sqlmysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ public function createdb_sql($dbname, $quoted = FALSE) {
// We can't easily know what IP adderss or hostname would represent our server.
$domain = ($this->db_spec['host'] == 'localhost') ? 'localhost' : '%';
$user = sprintf("'%s'@'%s'", $this->db_spec['username'], $domain);
$sql[] = sprintf("DROP USER IF EXISTS %s;", $user);
$sql[] = sprintf("CREATE USER %s IDENTIFIED WITH mysql_native_password;", $user);
$sql[] = sprintf("CREATE USER IF NOT EXISTS %s IDENTIFIED WITH mysql_native_password;", $user);
$sql[] = sprintf("SET PASSWORD FOR %s = PASSWORD('%s');", $user, $this->db_spec['password']);
$sql[] = sprintf('GRANT ALL PRIVILEGES ON %s.* TO %s;', $dbname, $user);
$sql[] = 'FLUSH PRIVILEGES;';
Expand Down