MySQL 设置 root 密码并使用 Instant Rails 后无法访问 PHPmyAdmin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2570003/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:42:30  来源:igfitidea点击:

Can't get access to PHPmyAdmin after setting a root password and using Instant Rails

mysqlruby-on-railsphpmyadminmysql-error-1045

提问by Derek

Wanted to get started with Ruby on Rails so I installed instant rails and set up a mysql password. Problem is now I can't get access to phpmyadmin.

想开始使用 Ruby on Rails,所以我安装了 Instant rails 并设置了 mysql 密码。问题是现在我无法访问 phpmyadmin。

From the rails control panel, when I go to configure >> database (via PhpMyadmin) it opens up phpmyadmin with the message

从 rails 控制面板,当我去配置 >> 数据库(通过 PhpMyadmin)它打开 phpmyadmin 与消息

Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password:

NO)

Error

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password:

不)

When I used to use XAMPP after setting a password instead of taking me directly within phpmyadmin (as it did without a password) it took me to the login screen instead. With instant rails that's not the case. Anyone had this problem when they first set a mysql password and using the instant rails package?

当我过去在设置密码后使用 XAMPP 而不是直接在 phpmyadmin 中(就像没有密码那样)时,它把我带到了登录屏幕。对于即时导轨,情况并非如此。当他们第一次设置 mysql 密码并使用 Instant rails 包时,有人遇到过这个问题吗?

回答by Vikas Ck

Edit your phpmyadmin config.inc.php file :

编辑您的 phpmyadmin config.inc.php 文件:

Path For Config Page is wamp\apps\phpmyadmin3.4.5\config.inc.php

配置页面的路径是 wamp\apps\phpmyadmin3.4.5\config.inc.php

$cfg['Servers'][$i]['verbose'] = 'localhost';

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

$cfg['Servers'][$i]['port'] = '3306';

$cfg['Servers'][$i]['socket'] = '';

$cfg['Servers'][$i]['connect_type'] = 'tcp';

$cfg['Servers'][$i]['extension'] = 'mysqli';

$cfg['Servers'][$i]['auth_type'] = 'config';

$cfg['Servers'][$i]['user'] = '**your-root-username**';

$cfg['Servers'][$i]['password'] = '**root-password**';

$cfg['Servers'][$i]['AllowNoPassword'] = true;

回答by Prem

Try to restart your browser after changing the config file.

更改配置文件后尝试重新启动浏览器。

回答by Uday Sawant

Check following lines in config.inc.php in phpmyadmin directory

检查 phpmyadmin 目录中 config.inc.php 中的以下几行

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'yourpassword';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

if your root account dont use any password set 'AllowNoPassword' to 'TRUE'

如果您的 root 帐户不使用任何密码,请将“AllowNoPassword”设置为“TRUE”

回答by shri

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

was missing from configuration.

配置中缺少。

回答by Muhammad Ashikuzzaman

Go to this directory "xampp/phpmyadmin" and open config.inc.phpfile. On a Mac, go to /Applications/XAMPP/xamppfiles/phpmyadmin. Then change and configure the below code with your desired requirements. It worked with me. I installed both MySQL and XAMPP and worked successfully.

转到此目录“ xampp/phpmyadmin”并打开config.inc.php文件。在 Mac 上,转到/Applications/XAMPP/xamppfiles/phpmyadmin。然后根据您的要求更改和配置以下代码。它和我一起工作。我安装了 MySQL 和 XAMPP 并成功运行。

$cfg['Servers'][$i]['controluser']  = 'Your Username';   
$cfg['Servers'][$i]['controlpass']  = 'Your passwaord';
$cfg['Servers'][$i]['auth_type']    = 'config';
$cfg['Servers'][$i]['user']         = 'Your Username';
$cfg['Servers'][$i]['password']     = 'Your password';

回答by Aju Palleri

I faced similar problem and found an easy way out. After changing the password in config.inc.php, phpmyadmindid not start and message was access denied for user xyz@localhost

我遇到了类似的问题,并找到了一个简单的出路。在 中更改密码后config.inc.phpphpmyadmin没有启动并且消息被用户 xyz@localhost 拒绝访问

Step by step solution:

分步解决:

  1. imp: do not change password directly from config.inc.
  2. in the config.inc.phpkeep the password blank

    $cfg['Servers'][$i]['password'] = '';

    this will allow phpmyadmin to open without password.

  3. Under tab USERSclick editpriviligesfor root->followed by change password.
  4. Now if you again try and open localhost/phpmyadmin, it shows error access denied
  5. Now open config.inc.php and set the same password for user that you set in phpmyadminexample:

    $cfg['Servers'][$i]['password'] = 'xyz@abc';

  6. Now open phpmyadminand it works!!

  1. imp:不要直接从config.inc.
  2. config.inc.php保持密码空白

    $cfg['Servers'][$i]['password'] = '';

    这将允许 phpmyadmin 在没有密码的情况下打开。

  3. 在选项卡下USERS单击editpriviligesroot->然后更改密码。
  4. 现在,如果您再次尝试打开localhost/phpmyadmin,则会显示错误访问被拒绝
  5. 现在打开 config.inc.php 并为您在phpmyadmin示例中设置的用户设置相同的密码:

    $cfg['Servers'][$i]['password'] = 'xyz@abc';

  6. 现在打开phpmyadmin,它的工作原理!

回答by PrazSam

This problem made me crazy.After a full day of wasting time I fixed it. I'm using WAMP.

这个问题让我发疯了。经过一整天的浪费时间,我修复了它。我正在使用 WAMP。

  • Password was removed using console.
  • WAMP was uninstalled.
  • Computer was restarted.
  • WAMP was re installed.(Now i was able to open PhpMyadmin correctly)
  • Then the Password was set using PhpMyadmin privileges.
  • " $cfg['Servers'][$i]['password'] = ''; " in " C:\wamp\apps\phpmyadmin3.4.5\config.inc.php " was edited like this " $cfg['Servers'][$i]['password'] = 'Password given in PhpMyadmin privileges'; "
  • Now there was not any problem to open PhpMyadmin even with root password.
  • This video may helpfull. >> http://www.youtube.com/watch?v=lBvfa1wmlbI
  • 密码已使用控制台删除。
  • WAMP 已卸载。
  • 计算机已重新启动。
  • 重新安装了 WAMP。(现在我可以正确打开 PhpMyadmin)
  • 然后使用 PhpMyadmin 权限设置密码。
  • " $cfg['Servers'][$i]['password'] = ''; " 在 " C:\wamp\apps\phpmyadmin3.4.5\config.inc.php " 中被这样编辑 " $cfg[' Servers'][$i]['password'] = ' PhpMyadmin 权限中给出密码';"
  • 现在即使使用root密码打开PhpMyadmin也没有任何问题。
  • 这个视频可能会有所帮助。>> http://www.youtube.com/watch?v=lBvfa1wmlbI

回答by Robin Hossain

I had this issues. I have fixed by changing phpmyadmin ini files configuration. As per xampp folder structure I found phpmyadmin configuration file in this location: C:\xampp\phpMyAdmin\config.inc.php

我有这个问题。我已经通过更改 phpmyadmin ini 文件配置进行了修复。根据 xampp 文件夹结构,我在此位置找到了 phpmyadmin 配置文件:C:\xampp\phpMyAdmin\config.inc.php

Just changing these line my problem solved.

只需更改这些行,我的问题就解决了。

$cfg['Servers'][$i]['password'] = '';

$cfg['Servers'][$i]['password'] = '';

to

$cfg['Servers'][$i]['password'] = 'password';

$cfg['Servers'][$i]['password'] = 'password';

Thank You !

谢谢你 !

回答by Yiga Mulindwa herbert

Check following lines in config.inc.php in phpmyadmin directory $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'yourpassword'; $cfg['Servers'][$i]['AllowNoPassword'] = false;

检查 phpmyadmin 目录中 config.inc.php 中的以下几行 $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'yourpassword'; $cfg['Servers'][$i]['AllowNoPassword'] = false;

The above worked for me.After editing the above file,i restarted the wamp and it was all fine

以上对我有用。编辑上面的文件后,我重新启动了 wamp,一切都很好

回答by Olda Stiller

I had same problem after i changed password in phpmyadmin. Iam usind xampp and windows. After i changed password in my phpmyadmin showed "access denied" and then after changes descripted below phpmyadmin showed blank page. I tried all advices and combinations given here, but problem still remained. I solved it through "config.inc.php", where i changed these lines

我在 phpmyadmin 中更改密码后遇到了同样的问题。我使用 xampp 和 windows。在我的 phpmyadmin 中更改密码后显示“访问被拒绝”,然后在下面描述的更改后 phpmyadmin 显示空白页面。我尝试了这里给出的所有建议和组合,但问题仍然存在。我通过“config.inc.php”解决了它,在那里我改变了这些行

$cfg['Servers'][$i]['password'] = 'new_changed_password';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

and then and final key - clear cache in your browser! good luck.

然后和最后一个键 - 清除浏览器中的缓存!祝你好运。