开发者

Can't get access to PHPmyAdmin after setting a root password and using Instant 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 proble开发者_如何转开发m when they first set a mysql password and using the instant rails package?


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;


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'


Try to restart your browser after changing the config file.


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';


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

was missing from configuration.


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!!


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.


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


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 !


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


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.


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.


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 ?


In case you want to reset password to NULL do following:

  • Run MySQL Console
  • It will ask you the password you set. Enter password.
  • Run following command:

    mysql>UPDATE mysql.user ->SET Password=PASSWORD("") ->WHERE User="root"; mysql>FLUSH PRIVILEGES;

  • You may now access your phpMyAdmin again with PASSWORD not set for root.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜