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

发布于 2024-08-27 04:53:48 字数 405 浏览 17 评论 0原文

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

从 Rails 控制面板,当我去配置>>时数据库(通过 PhpMyadmin)它打开 phpmyadmin 并显示消息

<前><代码>错误 MySQL 说: 文档 #1045 - 用户“root”@“localhost”的访问被拒绝(使用密码:

没有)

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

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.

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

Error

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

NO)

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

许久 2024-09-03 04:53:48

编辑您的 phpmyadmin 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;

Edit your phpmyadmin config.inc.php file :

Path For Config Page is 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;
勿忘心安 2024-09-03 04:53:48

请检查 phpmyadmin 目录中的 config.inc.php 中的以下行,将“AllowNoPassword”设置为“TRUE”

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

如果您的根帐户不使用任何密码,

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;

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

烟若柳尘 2024-09-03 04:53:48

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

Try to restart your browser after changing the config file.

抚你发端 2024-09-03 04:53:48

转到此目录“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';

Go to this directory "xampp/phpmyadmin" and open config.inc.php file. 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.

$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';
无力看清 2024-09-03 04:53:48
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

配置中丢失。

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

was missing from configuration.

葬花如无物 2024-09-03 04:53:48

我遇到了类似的问题并找到了一个简单的解决方法。
config.inc.php中更改密码后,
phpmyadmin 未启动,用户 xyz@localhost 的访问被拒绝

分步解决方案:

  1. imp:不要直接从 config.inc 更改密码。
  2. config.inc.php中将密码保留为空

    $cfg['服务器'][$i]['密码'] = '';

    这将允许 phpmyadmin 无需密码即可打开。

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

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

  6. 现在打开 phpmyadmin 就可以了!

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

Step by step solution:

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

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

    this will allow phpmyadmin to open without password.

  3. Under tab USERS click editpriviliges for 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 phpmyadmin
    example:

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

  6. Now open phpmyadmin and it works!!

℉絮湮 2024-09-03 04:53:48

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

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

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

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

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

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

不…忘初心 2024-09-03 04:53:48

这个问题让我抓狂。浪费了一整天的时间后我解决了它。我用的是WAMP。

  • 使用控制台删除密码。
  • WAMP 已卸载。
  • 计算机已重新启动。
  • WAMP 已重新安装。(现在我可以正确打开 PhpMyadmin)
  • 然后使用 PhpMyadmin 权限设置密码。
  • “ C:\wamp\apps\phpmyadmin3.4.5\config.inc.php ”中的“ $cfg['Servers'][$i]['password'] = ''; 编辑如下“ $cfg[' Servers'][$i]['password'] = 'PhpMyadmin 权限中给出的密码 ';
  • 现在即使使用 root 密码打开 PhpMyadmin 也没有任何问题。
  • 该视频可能会有所帮助。 >>> http://www.youtube.com/watch?v=lBvfa1wmlbI

This problem made me crazy.After a full day of wasting time I fixed it. I'm using 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
柳若烟 2024-09-03 04:53:48

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

只需更改这些行即可解决我的问题。

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

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

谢谢!

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

Just changing these line my problem solved.

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

to

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

Thank You !

少女的英雄梦 2024-09-03 04:53:48

检查 phpmyadmin 目录中的 config.inc.php 中的以下行
$cfg['服务器'][$i]['用户'] = 'root';
$cfg['服务器'][$i]['密码'] = '你的密码';
$cfg['服务器'][$i]['AllowNoPassword'] = false;
上面的内容对我有用。

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

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;

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

唯憾梦倾城 2024-09-03 04:53:48

您有一个没有密码的 root 帐户。最好查看位于 phpmyadmin 目录中的conf 文件并检查密码。

You have a root account with no password. It would be best to have a look into the conf file located in your phpmyadmin directory and check with the password.

清泪尽 2024-09-03 04:53:48

Rails-mysql-lost-password

如果您是 Rails 开发人员并且丢失了 mysql 的密码:

此答案与发生此行为的 Ruby on Rails 框架有关,

  1. 具有用户 root 和密码的 mysql
  2. 引导新的 Rails 项目
    与 mysql 一起使用“rails 新项目名称
    -d mysql"
  3. 不要修改 config/database.yml - 服务器的默认凭据是名称:root,密码为空
  4. rake db:create 提示显示 - 询问 root 密码,然后当您提供 root 密码时,

答案在 GRANT 命令中在此处的第68行

基本上它执行了GRANT命令,其凭据与您当前的database.yml

匹配已经讨论了这个主题,行为将会得到改善,并且它被视为错误并报告。

rails-mysql-lost-password

If you are rails developer and you have lost password for mysql :

This answer is in connection with Ruby on Rails framework where this behavior occurred

  1. have mysql with user root and password
  2. bootstrap new rails project
    using with mysql "rails new projectname
    -d mysql"
  3. do not modify config/database.yml - defaults credentials for server are name: root, password is blank
  4. rake db:create prompt show up - asking for root password and then when you provide root password

the answer is in GRANT command on line 68 in here

basically it executed GRANT command with credentials matches your current database.yml

I have discussed this topic and behavior will improved and it is taken and reported as a bug.

等风来 2024-09-03 04:53:48

我一直在寻找答案,但它真的很容易解决...

打开 XAMPP 应用程序 ->转到常规然后打开终端

执行以下命令:

mysqladmin --user=root --password=[OLD_PASSWORD] 密码 ""

但是如何设置 root 密码?而又不会失去对 phpmyadmin 的访问权限?

I was looking for an answer but it's really easy to solve...

Open XAMPP App -> Go to General then open Terminal

execute the following command:

mysqladmin --user=root --password=[OLD_PASSWORD] password ""

But how to set a root password? without losing access to to phpmyadmin ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文