When a user formatted PC and re-installed local server (XAMPP) then sometimes user got 1045 error message. This occurs when root@localhost wasn’t granted the essential rights a user tries to access phpMyAdmin after successful installation of the local server. Here is the complete error message which occurs on screen:
#1045 Access Denied for user 'root'@'localhost' (using password: YES)
We have different servers to use MySQL database like: WAMP, MAMP, LAMP and XAMPP. WAMP is for Windows, LAMP for Linux, MAMP for Mac OS X and XAMPP for all operating systems. It also supports perl, mercury mail, filezilla and some scripts. In this blog, I will try to help users to get rid from this error for any local host server by the use of phpMyAdmin.
User can try following methods to resolve this error. Your problem might be fixed using the first method or you have to perform all three.
First Method
Third Method:Open the config.inc.php file which is located in localhost ->xampp ->phpmyadmin->config.inc.php
#1045 Access Denied for user 'root'@'localhost' (using password: YES)
We have different servers to use MySQL database like: WAMP, MAMP, LAMP and XAMPP. WAMP is for Windows, LAMP for Linux, MAMP for Mac OS X and XAMPP for all operating systems. It also supports perl, mercury mail, filezilla and some scripts. In this blog, I will try to help users to get rid from this error for any local host server by the use of phpMyAdmin.
First Method
- Start the command prompt and go to the XAMPP directory: cd ../../Program Files/xampp
- Now go to xampp->mysql->bin
- Now run the following command: mysql.exe --user=root --password=
- After this, MySQL command line will start and we can change the –user= and –password= accordingly.
Second Method: In this method we create the batch file to make it easier. To do this just follows simple steps:
- Create a file mysql_command.bat in the XAMPP folder and edit this file with any text editor and paste in this:
@echo offechoMySQL command line...mysql\bin\mysql.exe --user=root --password=pause - Save the file and change the username and password if you changed username and password. Now run command.bat and command prompt will display with MySQL command line in running condition.
- Open this file using any text editor.
- Now find the code $cfg['Servers'][$i]['password'] = ''; // MySQL password
- Now change the password which you have created in step 1.
- Click on the Save button.
Very helpful post for me. I fix this error by first method.
ReplyDeleteIt is good to hear that, this post helps you to fix the error.
ReplyDelete