How To Resolve MySQL ERROR 1045 (28000): Access Denied For User?

Fix MySQL ERROR 1045 (28000): Access Denied For User

After completing the installation of a local host server, if you try to access the phpMyAdmin, then you may encounter MySQL error 1045 (28000) access denied for user ‘root’@’localhost’ (using password: YES). This error primarily comes into action when the local host is not assigned with complete accessing authority or may be the password that is facilitated is incorrect. If these things will be happening then you may come across this error. But, you need not worry, in this article you will be guided properly to find a way around for avoiding & solving MySQL error 1045 (28000): access denied for user.

Image will appear as shown below;

MySQL ERROR 1045 (28000): Access Denied For User

How to Fix MySQL ERROR 1045 (28000): Access Denied For User?

By following the below mentioned steps, you can easily troubleshoot MySQL error 1045 SQLstate 28000 access denied for user. So, just follow them one-by-one to resolve such error.

Step 1: Open MySQL console

With the help of WAMP, do left click on your WAMP icon positioned at the bottom right area of the screen of your desktop and go to MySQL console.

But this part can be ignored if you already have the correct password;

  • First of all, type: use mysql
  • Next, hit the enter
  • Set password for MySQL: Update mysql.user

Step 2: Set Password= PASSWORD (Enter Your Password Here)

Where User=”root

  • Replace your password with your chosen password
  • After that, you need to hit the Enter
  • Wash out the Priviliges
  • Now, click on Exit
  • Again hit the Enter

Step 3: Open config.inc.php file situated in files of local server and edit it.

Make use of a text editor like Notepa++ to open config.inc.php file.

  • Switch to My Computer> C Drive> (Folder Of Local Server MAMP/XAMPP/WAMP)> APPS> PHPMYADMIN> Config.inc.php
  • Locate this line of code: $cfg [‘Servers’][$i][‘password’] = “; //MySQL password
  • Make alteration with the freshly created password from step 2.
  • Click save

Step 4: Access phpMyAdmin

You can make access of phpMyAdmin by switching to the http://localhost/phpMyAdmin/

After finishing all the steps above hopefully you will be able to access the database with no issue. Even after trying all these steps, if you are still getting error 1045 mysql 28000 access denied for user ‘root’@’localhost’ Windows then ty the below solution.

Fully Automated Solution To Solve Access Denied For User ‘Root’@’Localhost’ (Using Password: No)

If the above stated solution does not help you to get rid of error 1045 MySQL 28000 access denied for user MySQL then you can try MySQL Repair Tool. This software is the most reliable tool to repair corrupted and damaged database files along with the several MySQL database errors and issues.

Apart from that, it can easily recovers stored procedures, views, indexes, tables, unique/primary keys etc. without any backup. So, you need to just download & install this excellent program to fix MySQL error 1045 SQLstate 28000 access denied for user and other issues easily.


STEPS TO SOLVE  ERROR 1045 (28000):

Step 1: Start with Stellar Phoenix Database Repair for MySQL . Software and you can see the main interface as shown below.1

Step 2: Click on ‘Select’ button & then select ‘Repair corrupt database which is stored at default location of MySQL’ option to select your database from default location and then click.2

Step 3: The left pane shows the preview of database and its component in a tree like structure after completing scanning process.3

Step 4: After previewing your database, to start repair process click ‘Repair’ button in file menu on the main user interface. Stellar Phoenix Database Repair for MySQL dialog box appears. Click Yes.

4

Step 5: After successful completion of the process, a message box is displayed as ‘repair process finished successfully’. Click ‘OK’ to close the message box.5

The FAQ (Frequently Asked Questions)

How Do I Troubleshoot MySQL?

In order to troubleshooting problems starting with MySQL server, you need to follow the below steps:

  • Check the error log to see why the server does not start.
  • Make sure that the server knows where to find the data directory.
  • Specify any special options needed by the storage engines that you are using.
  • Ensure that a server can access the data directory.

How Do I Access Root MySQL?

To access root MySQL, you have to create the MySQL databases & users

  • At the command line, log in to MySQLas the root user: MySQL -u root -p.
  • Next, type the MySQL rootpassword, and then hit the Enter.
  • Type \q to exit the MySQL
  • To log in to MySQLas the user you just created, type the following command. …
  • At last, type the user’s password, and then press Enter.

Bottom Line

Now you have learned that how to bypass the error 1045 MySQL 28000 access denied for user MySQL further.

In the above section of this post, I have mentioned the different approaches to fix this issue. But if you want the easiest & fastest way to resolve this error then you can go with the MySQL Repair Tool.

If you liked this article, then do not forget to share it with your friends and family members.