且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

phpMyAdmin无法登录到Centos 7上的MySQL服务器

更新时间:2021-08-04 21:24:38

我能够通过执行以下操作来解决此问题:(我应该提到的是,该解决方案适用于MySQL 8.0.13和phpMyAdmin 4.8.4-两者均为最新版本)

I was able to resolve this by doing the following: (I should mention that this solution works for MySQL 8.0.13 and phpMyAdmin 4.8.4 - Both, latest version today)

1-我使用以下服务器参数(仅)编辑了 config.inc.php :

1- I edited config.inc.php with these server parameters (only):

/*** This is needed for cookie based authentication to encrypt password in 
cookie. Needs to be 32 chars long. */
$cfg['blowfish_secret'] = 'generate_your_blowfish_secret_32_chars'; 

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';

/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

2-在MySQL终端上

2- On MySQL terminal

//Create a new user:
mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'your_password';

//Grant all privileges:
mysql> GRANT ALL PRIVILEGES ON *.* To 'user'@'localhost' WITH GRANT OPTION;

//Flush all privileges:
mysql> FLUSH PRIVILEGES;

//Change authentication_string with password:
mysql> ALTER USER user IDENTIFIED WITH mysql_native_password BY 
'your_password';

//Login with the new user and password!

这应该允许您登录phpMyAdmin.希望对您有所帮助!

This should allow you to login into phpMyAdmin. I hope this help!