Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in SQL by (6.1k points)
edited by

I have installed PHPMyAdmin on my windows machine running IIS 7.0.
I was able to connect to MySQL using command-line, But I can;t able to connect using PHPMyAdmin.
The error displayed was: Error #1045 Cannot log in to the MySQL server.
Can anyone please help me with this ?

PHP Version 5.4.0
mysqlnd 5.0.10 - 20111026 - $Revision: 323634 $

And this is the file in the PHPMyAdmin folder:

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

if (!defined('PHPMYADMIN')) {

 * 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')); ?>
        <textarea cols="50" rows="20" name="textconfig" id="textconfig" spellcheck="false"><?php
            echo htmlspecialchars(ConfigGenerator::getConfigFile())
    <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"' ?> />

which part of these codes should I have to change? 

1 Answer

0 votes
by (12.7k points)

You need to do two things :

One you have to map the changed login credentials in phpmyadmin's

and the second, you need to restart your web and MySQL servers.

PHP version is not the issue need to go to phpmyadmin installation directory and find file 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

 Interested in SQL ? Check out this SQL Certification by Intellipaat.

Related questions

0 votes
1 answer
asked Dec 19, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories