PhpMyAdmin - Access denied for user root@localhost

Last update on October 30, 2009 09:50 AM by jak58
Published by jak58

PhpMyAdmin - Access denied for user root@localhost








Beginners may face the problem of accessing MySql by the root user. This issue happens when the root requires you to insert a password and the user has either entered a wrong password or has not provided any. This can be easily configured by the following steps:
  • Step1: Open MySql
  • Step2: Through the phpMyAdmin/librarires, you should edit the config.inc.php. where it is displayed $cfg['PmaAbsoluteUri'] = ''; alter the command to $cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';
  • Step 3: Concerning the server commands, edit $cfg['Servers'][$i]['host'] = 'localhost'; and alter it to $cfg['Servers'][$i]['host'] = 'Localhost';
  • Step 4: To enter your new password for the root user, choose the command $cfg['Servers'][$i]['password'] = ''; and enter your password in between the fields provided.


For example:

$cfg['Servers'][$i]['password'] = 'type your password here';
  • Step 5: After this procedure, do not forget to reboot MySql


To reset the rights of the root user


To be able to reset the rights of the root user, you should enter the following commands
mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY ' your current password ' WITH GRANT

Insert the host and password


This section will allow you to insert the host's name and user account by default and set them with the correct password allocated to them in the php.ini folder. To do so, use the code below:

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host ='localhost'

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user ='root'

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysqli.default_pw =' your current password '
Best answers for « PhpMyAdmin Access denied for user root@localhost » in :
PhpMyAdmin - Access denied for user root’@localhost Show PhpMyAdmin - Access denied for user root’@localhost To reset the rights of the root user Insert the host and password Beginners may face the problem of accessing MySql by the root user. This issue happens when the root requires you to...
Server Response: Error 554 -Relay Access denied Show Server Response: Error 554 -Relay Access denied Issue Solution Issue Below error message appears on your screen before your connection: Error 554 - Access Denied Relay Solution This may be due to the use of outgoing server...
Unable to connect the printer , Access Denied Show Unable to connect the printer , Access Denied Issue Solution Issue Under Windows 2000/XP based environment ,whenever i try to take printing from my network printer (printer attached to other windows based system) , I was prompted by ...
Server Response: ERROR 554 - RELAY ACCESS DENIED ShowServer Response: ERROR 554 - RELAY ACCESS DENIED Your email client displays the following error: Error 554 - Relay Access Denied This is to the use of an outgoing server (SMTP) outside the provider field. Due to spam, SMTP...
[Vista] Take control over a file whose access is denied Show[Vista] Take control over a file whose access is denied Most Vista users have encounter the following type of message: "Access denied" when trying to edit some files or folder. To solve this problem: Right click the folder...
Reinitializing the root password of MySQL ShowReinitializing the root password of MySQL The root password is lost! Reinitializing the password: It's important that you are able to access and modify the admin (root) password of MYSQL, either when installing MySQL for the first...
File sharing in Windows XP ShowAdvantages File sharing involves making the content of one or more directories available through the network. All Windows systems have standard devices making it easy to share the content of a directory. However, file sharing may lead to security...
Msconfig - msconfig.exe Showmsconfig - msconfig.exe msconfig.exe (msconfig) is a standard process in Windows XP (and earlier versions of Windows) for editing the startup configuration. MsConfig is mainly used for removing processes loaded when Windows is booted. How do you...