将密码设置为数据库后无法访问phpMyAdmin [英] Unable to access phpMyAdmin after a password is set to the database

查看:99
本文介绍了将密码设置为数据库后无法访问phpMyAdmin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将密码设置为MySQL之后,phpMyAdmin拒绝访问数据库,并显示以下错误:

After I set password to MySQL, phpMyAdmin is denying access to the database and is showing the following error:

MySQL说:

MySQL said:

1045-用户'root'@'localhost'的访问被拒绝(使用密码:NO)

1045 - Access denied for user 'root'@'localhost' (using password: NO)

我已经用它搜索了一下,并试图弄乱配置文件,我尝试了一切,但无法提出解决方案.我什至经历了之前有关Stack Overflow的问题,但是那里的答案也没有改变情况.

I have googled it and tried to mess with the config file, I tried everything, but couldn't come up with a solution. I even went through the previous questions of Stack Overflow, but the answers there also didn't change the situation.

这是我的config.inc.php文件:

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type']            = 'config';
$cfg['Servers'][$i]['user']                 = 'root';
$cfg['Servers'][$i]['password']             = 'root';
$cfg['Servers'][$i]['AllowNoPassword']      = true;

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

/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysqli';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'root';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb']            = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable']    = 'pma_bookmark';
$cfg['Servers'][$i]['relation']         = 'pma_relation';
$cfg['Servers'][$i]['table_info']       = 'pma_table_info';
$cfg['Servers'][$i]['table_coords']     = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages']        = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info']      = 'pma_column_info';
$cfg['Servers'][$i]['history']          = 'pma_history';
$cfg['Servers'][$i]['designer_coords']  = 'pma_designer_coords';

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir']   = '';
$cfg['SaveDir']     = '';

$cfg['AllowAnywhereRecoding']       = true;
$cfg['DefaultCharset']              = 'utf-8';
$cfg['DefaultLang']                 = 'en-utf-8';
$cfg['DefaultConnectionCollation']  = 'utf8_general_ci';

$cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/refman/5.1/en';
$cfg['MySQLManualType'] = 'searchable';

?>

推荐答案

这是phpmyadmin config.inc.php文件的代码:

Here's the code you should have for the phpmyadmin config.inc.php file:

   <?php

          $i = 0;
          $i++;
          $cfg['Servers'][$i]['host'] = 'localhost';
          $cfg['Servers'][$i]['connect_type'] = 'tcp';
          $cfg['Servers'][$i]['auth_type'] = 'http';
          $cfg['Servers'][$i]['compress'] = false;
          $cfg['Servers'][$i]['extension'] = 'mysql';
          $cfg['Servers'][$i]['AllowNoPassword'] = false;

   ?>

如果主机配置出现问题,则应使用:

If you are having issues w the host configuration, you should use:

         $cfg['Servers'][$i]['host'] = '127.0.0.1';

如果这不起作用,这是不需要任何编码的另一种解决方法:

If that doesn't work, here's another work-around that doesn't require any coding:

  • 在浏览器中的PHPMyAdmin文件夹下打开/scripts/signon.php页面
  • 输入登录详细信息
  • 然后弹出另一个登录屏幕,输入mysql详细信息

这篇关于将密码设置为数据库后无法访问phpMyAdmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆