Error # 1045 - Cannot Log in to MySQL server -> phpmyadmin

1040 cannot log in to the mysql server phpmyadmin
cannot log in to the mysql server phpmyadmin centos 7
cannot log in to the mysql server wamp
2005 cannot log in to the mysql server
1040 cannot log in to the mysql server
2054 cannot log in to the mysql server
cannot log in to the mysql server mac
2002 cannot log in to the mysql server

We have installed PHPMyAdmin on a windows machine running IIS 7.0. We are able to connect to MySQL using command-line, But we are not able to connect using PHPMyAdmin. The error displayed is: Error #1045 Cannot log in to the MySQL server. Can somebody please help?

PHP Version 5.4.0 mysqlnd 5.0.10 - 20111026 - $Revision: 323634 $ phpMyAdmin-3.5.4-rc1-all-languages.7z

EDIT : I followed the link below with no success, mean i changed that password but phpmyadmin still has that error... C.5.4.1.1. Resetting the Root Password: Windows Systems

Also there is thread like below in stack with no help : Random error: #1045 Cannot log in to the MySQL server but that error is not random -> i always have that error...

And this is config.inc.php file in phpmyadmin folder:

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Config file view and save screen
 *
 * @package PhpMyAdmin-setup
 */

if (!defined('PHPMYADMIN')) {
    exit;
}

/**
 * Core libraries.
 */
require_once './libraries/config/FormDisplay.class.php';
require_once './setup/lib/index.lib.php';
require_once './setup/lib/ConfigGenerator.class.php';

$config_readable = false;
$config_writable = false;
$config_exists = false;
check_config_rw($config_readable, $config_writable, $config_exists);
?>
<h2><?php echo __('Configuration file') ?></h2>
<?php display_form_top('config.php'); ?>
<input type="hidden" name="eol" value="<?php echo htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) ?>" />
<?php display_fieldset_top('', '', null, array('class' => 'simple')); ?>
<tr>
    <td>
        <textarea cols="50" rows="20" name="textconfig" id="textconfig" spellcheck="false"><?php
            echo htmlspecialchars(ConfigGenerator::getConfigFile())
        ?></textarea>
    </td>
</tr>
<tr>
    <td class="lastrow" style="text-align: left">
        <input type="submit" name="submit_download" value="<?php echo __('Download') ?>" class="green" />
        <input type="submit" name="submit_save" value="<?php echo __('Save') ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
    </td>
</tr>
<?php
display_fieldset_bottom_simple();
display_form_bottom();
?>

where part of these codes should i change?

Thanks.

You need to do two additional things after following the link that you have mentioned in your post:

One have to map the changed login cridentials in phpmyadmin's config.inc.php

and second, you need to restart your web and mysql servers..

php version is not the issue here..you need to go to phpmyadmin installation directory and find file config.inc.php and in that file put your current mysql password at line

$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'password'; //mysql password here

phpmyadmin #1045 Cannot log in to the MySQL server. after , In case MySQL Server is up but you are still getting the error: For anyone who still have this issue, I followed awesome tutorial  The post provides steps to resolve phpMyadmin error, 1045 Cannot log in to the MySQL server, received while logging in the phpMyAdmin.

In Linux I resolve this problem by going to the root command prompt type:

# mysqladmin -u root password 'Secret Phrase Here'

Then go back and login. Works every time!

Error # 1045 - Cannot Log in to MySQL server , You need to do two additional things after following the link that you have mentioned in your post: One have to map the changed login  In mysql 5.7 the auth mechanism changed, documentation can be found in the official manual here.. Using the system root user (or sudo) you can connect to the mysql database with the mysql 'root' user via CLI.

If you are installing first time then please try login with username and password as root

[RESOLVED] Error: “1045 cannot log in to the MYSQL server”, PhpMyAdmin is a free tool which is provide for MYSQL database management. With this free software we can manage databases easily like  #1045 Cannot log in to the MySQL server, this was the error I got today on a phpMyAdmin installation inside a cPanel server while trying to access the application. phpMyAdmin is one of the best tools to handle your MySQL databases and tables inside cPanel servers. However, sometimes we get strange errors while trying to use it.

another thing that worked for me after everything didn't - change "localhost" in config.inc.php to 127.0.0.1

#1045 Cannot log in to the MySQL server message, Hi, total newbie here. I need to be able to use the WAMP Server 2.4, phpMyAdmin. I am getting the error message: #1045 Cannot log in to the  [RESOLVED] Error: “1045 cannot log in to the MYSQL server”. PhpMyAdmin is a free tool which is provide for MYSQL database management. With this free software we can manage databases easily like create, delete, drop, import, export and alter. You can also run MYSQL queries in PHPMyAdmin to complete your task.

In mysql 5.7 the auth mechanism changed, documentation can be found in the official manual here.

Using the system root user (or sudo) you can connect to the mysql database with the mysql 'root' user via CLI. All other users will work, too.

In phpmyadmin however, all mysql users will work, but not the mysql 'root' user.

This comes from here:

$ mysql -Ne "select Host,User,plugin from mysql.user where user='root';"
+-----------+------+-----------------------+
| localhost | root | auth_socket |
|  hostname | root | mysql_native_password |
+-----------+------+-----------------------+

To 'fix' this security feature, do:

mysql -Ne "update mysql.user set plugin='mysql_native_password' where User='root' and Host='localhost'; flush privileges;"

More on this can also be found here in the manual.

PHPMyAdmin Error; #1045 Cannot log in to the MySQL server , Hello Jackk, PhpMyAdmin is a free tool which is provide for MYSQL database management. The error you reffered seems to be of some MySQL  #1045 Cannot log in to the MySQL server Access denied for user 'root'@'localhost' (using password: YES) I googled the problem and also I have tried to reinstall all installed components, but the same result came up! in windows i usually modified the content of mysql configure file but in ubuntu nothing is as same as windows!:)

Error # 1045 - Cannot Log in to MySQL server , Try te following: 1) Login to MySQL server using your console. 2) update mysql.​user set PASSWORD=PASSWORD('newpassword') where  I followed the directions to successfully change the pw and now cannot get into the WAMP Server . . . I have gone in and tried, successfully to change the pw. Still no luck.

apache2 - #1045 Cannot log in to the MySQL server, I think that you should reset the password of root user. How to reset MySQL root password. To reset your mysql password of root user, just  Hi. What did you use as your “host” in the PHPMyAdmin config? Depending on what you have there, the system (/etc/hosts) could interpret it differently and all of a sudden MySQL “thinks” the connection is remote.

#1045 Cannot log in to the MySQL server - General, #1045 Cannot log in to the MySQL server clear step by step instructions and command line code that I can copy paste to fix the problem. @Parto when I am running mysql -u root it again give error, ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) – drakpasanger Sep 26 '14 at 19:38 I hope you are not still using a root terminal - that is as sudo su ?

Comments
  • thanks for the answer -> would you please explain more. also i think that phpmyadmin does not support php 5.4.0! am i right? should i change php version or not?
  • i guess you have pasted code of phpmyadmin's index.php..i have updated my answer..pls check..
  • thanks for the edit -> but i do n't have these lines in that file -> please see my edit again.
  • no, it's config.inc.php file -> i 've downloaded from here -> sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.4-rc1/…
  • there's a catch..thanks for giving me the download link to make things clear..you have pasted code from /setup/config.php but i am talking about /config.inc.php which in this setup doesn't exist..so you need to rename /config.sample.inc.php to config.inc.php and paste the above code in it after $cfg['Servers'][$i]['host'] = 'localhost'; line..
  • The only thing that fixed problem with priviliges over vagrant! 4 hours of searching, adding comment in case someone will stumble uppon simmilar problem with phpmyadmin installation in vagrant virtualbox. + it will work in provisional.sh