HOW TO SOLVE ERROR #1045


HOW TO SOLVE ERROR #1045 for your phpMyAdmin(WAMP/MAMP/XAMPP)

Error #1045 when your root@localhost database user is denied the necessary rights to access the database, or when you provide wrong password. In such cases when you try to access your phpMyAdmin you get the following error” 

#1045 Access Denied for user 'root'@'localhost' (using password: YES).
This tutorial will guide you on the steps to follow in order to solve this problem. This tutorial will assume that you already have your wamserver running.
Step 1. Open MySQL Console. You do this by clicking WAMP icon located at the bottom right of your computer.


Hover over MySQL and follow the sub-menu arrow. Click on MySQL Console. 



Skip this part if you have a password already.
To set your MySQL password type:
                   Use MySQL
Then press Enter.
You will see the following:

Step 2. Enter the Provided Commands

 

 


Add the following command so as to set MySQL password, replace "EnterYourPasswordHere" with your preferred password.
Press Enter.
Next flush the privileges by typing:
  FLUSH PRIVILEGES;
Now you can Exit by typing:
   Exit
Press Enter.

Step 3 Edit the config.inc.php File

In this step, we will see how to edit the config.inc.php.
You can access this php script file by going to your Local Server Folder; in our case, we are using WAMP. The WAMP location is C:\wamp. Inside this folder open Apps folder, then PhpMyAdmin folder. There you will find the config.inc.php file.






Use a text editor such as Notepad, Notepad++ or phpEditor to open this file(config.inc.php)
Look for the following line:

$cfg['Servers'][$i]['password'] = 'xxxx'; // MySQL password

NOTEPAD EXAMPLE

Notepad
 PHP EDITOR EXAMPLE


Change the 'xxxx' to the newly chosen password you created in Step #2.
It changed line should look like this:
$cfg['Servers'][$i]['password'] = '123paswd'; // MySQL password
Make sure to set your own password, the one you chose in step 2.
Finally Click Save and close the file.



Comments

Popular posts from this blog

How to paste image into picturebox from clipboard with VB.Net

CREATING CRYSTAL REPORTS VB.NET 2012 STEP BY STEP - PART 2

How to Create Crystal Report using Visual Studio 2012 Part 1