Heim  >  Artikel  >  php教程  >  修改mysql密码phpmyadmin不能登录

修改mysql密码phpmyadmin不能登录

WBOY
WBOYOriginal
2016-05-25 16:52:30735Durchsuche

出现phpmyadmin不能登录是我在修改我mysql服务器密码之后导致的,后来百度了相关的原因,原来是修改了mysql密码之后我们还需要在phpmyadmin目录中去修改config.inc.php中的内容。

错误提示:#1045 - Access denied for user 'root'@'localhost' (using password: YES)

phpmyadmin目录中找到config.inc.php文件,修改如下位置即可,对于config.inc.php文件,最重要的即是修改加入phpMyAdmin连接MySQL的用户名和密码,寻找到代码行:

// $cfg['Servers'][$i]['controluser'] = 'pma';

// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

将"//"注释号删除,同时输入MySQL中配置的用户名和密码比如这里:

$cfg['Servers'][$i]['controluser'] = 'ids.la';

$cfg['Servers'][$i]['controlpass'] = '*********';

注意:如果需要通过远程服务器调试使用phpMyAdmin,则需要添加blowfish_secret内容定义Cookie,寻找到代码行:

$cfg['blowfish_secret'] = '';

设置内容为COOKIE

$cfg['blowfish_secret'] = 'leosn';

Linux下phpmyadmin不能登录连接MySQL,且无任何提示的问题解决方法

问题如下:php环境已经配好,正常,phpmyadmin不能登录,不论密码输入是否正确,都没有任何错误提示,自动跳转回到登录页面。

解决方法:

1、在php.ini 找到session.save_path 这一行,设成session.save_path = “/var/lib/php/session”,并把前面的分号去掉,以上的/var/lib/php/session根据你实际情况设定。

2、修改此目录的权限和属主:

# chown -R nobody:nobody /var/lib/php/session(nobody权限很低,最好设置它为web运行账户)

# chmod 777 /var/lib/php/session(session目录至少设置770权限以上,否则phpmyadmin登录会有问题)

3、重启相关服务,如果是apache,就重启apache服务:/etc/init.d/httpd restart;如果是nginx,就重启php-fpm服务,代码如下:

:/etc/init.d/php-fpm restart

文章网址:

随意转载^^但请附上教程地址。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn