use default caching_sha2_password auth plugin for mysql8
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -110,7 +110,7 @@ class DbManager
|
|||||||
$users = $dbm->getManager()->getAllSqlUsers(false);
|
$users = $dbm->getManager()->getAllSqlUsers(false);
|
||||||
|
|
||||||
foreach ($databases[$dbserver['dbserver']] as $username) {
|
foreach ($databases[$dbserver['dbserver']] as $username) {
|
||||||
if (isset($users[$username]) && is_array($users[$username]) && isset($users[$username]['hosts']) && is_array($users[$username]['hosts'])) {
|
if (isset($users[$username]['hosts']) && is_array($users[$username]['hosts'])) {
|
||||||
|
|
||||||
$password = [
|
$password = [
|
||||||
'password' => $users[$username]['password'],
|
'password' => $users[$username]['password'],
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ class DbManagerMySQL
|
|||||||
*/
|
*/
|
||||||
public function grantPrivilegesTo(string $username, $password, string $access_host = null, bool $p_encrypted = false, bool $update = false, bool $grant_access_prefix = false)
|
public function grantPrivilegesTo(string $username, $password, string $access_host = null, bool $p_encrypted = false, bool $update = false, bool $grant_access_prefix = false)
|
||||||
{
|
{
|
||||||
$pwd_plugin = 'mysql_native_password';
|
// this is required for mysql8
|
||||||
|
$pwd_plugin = 'caching_sha2_password';
|
||||||
if (is_array($password) && count($password) == 2) {
|
if (is_array($password) && count($password) == 2) {
|
||||||
$pwd_plugin = $password['plugin'];
|
$pwd_plugin = $password['plugin'];
|
||||||
$password = $password['password'];
|
$password = $password['password'];
|
||||||
@@ -278,7 +279,7 @@ class DbManagerMySQL
|
|||||||
if (!isset($allsqlusers[$row['User']]) || !is_array($allsqlusers[$row['User']])) {
|
if (!isset($allsqlusers[$row['User']]) || !is_array($allsqlusers[$row['User']])) {
|
||||||
$allsqlusers[$row['User']] = [
|
$allsqlusers[$row['User']] = [
|
||||||
'password' => $row['Password'] ?? $row['authentication_string'],
|
'password' => $row['Password'] ?? $row['authentication_string'],
|
||||||
'plugin' => $row['plugin'] ?? 'mysql_native_password',
|
'plugin' => $row['plugin'] ?? 'caching_sha2_password',
|
||||||
'hosts' => []
|
'hosts' => []
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user