The reason why phpmyadmin cannot log in was after I changed the password of my mysql server. Later, Baidu found out the relevant reason. It turned out that after changing the mysql password, we still need to modify the contents of config.inc.php in the phpmyadmin directory. .
Error message
#1045 - Access denied for user 'root'@'localhost' (using password: YES)
Find the config.inc.php file in the phpmyadmin directory and modify the following location
For the config.inc.php file, the most important thing is to modify the username and password to join phpMyAdmin to connect to MySQL. Find the line of code:
The code is as follows | Copy code | ||||
// $cfg['Servers'][$i]['controluser'] = 'pma'; |
代码如下 | 复制代码 |
$cfg['Servers'][$i]['controluser'] = 'ids.la'; $cfg['Servers'][$i]['controlpass'] = '*********'; |
The code is as follows | Copy code |
$cfg['Servers'][$i ]['controluser'] = 'ids.la'; $cfg['Servers'][$i]['controlpass'] = '************'; |
代码如下 | 复制代码 |
$cfg['blowfish_secret'] = ''; |
Note: If you need to use phpMyAdmin through remote server debugging, you need to add the blowfish_secret content definition cookie and look for the line of code:
The code is as follows | Copy code | ||||
$cfg['blowfish_secret'] = '';
|
The code is as follows | Copy code |
$cfg['blowfish_secret'] = 'leosn'; |
The question is as follows:
The php environment has been configured and is normal. phpmyadmin cannot log in. No matter whether the password is entered correctly or not, there is no error message and it automatically jumps back to the login page
Noodles.
1. Find the session.save_path line in php.ini, set it to session.save_path = “/var/lib/php/session”, and replace the previous
代码如下 | 复制代码 |
# chown -R nobody:nobody /var/lib/php/session |
The above /var/lib/php/session is set according to your actual situation.
代码如下 | 复制代码 |
# chmod 777 /var/lib/php/session |
The code is as follows | Copy code |
# chmod 777 /var/lib/php/ session |
(Session directory must be set to at least 770 permissions, otherwise there will be problems logging in to phpmyadmin.)
3. Restart related services. If it is apache, restart the apache service: /etc/init.d/httpd restart; if it is nginx, restart php-fpm
Service
代码如下 | 复制代码 |
:/etc/init.d/php-fpm restart |