How to fix MYSQL Error 1045 Access Denied for user in Windows??

Synopsis: Let us learn to fix MYSQL Error 1045 Access Denied for user in Windows Operating System.

When user re-install local server XAMPP on a formatted PC then sometimes the user receives a My SQL error 1045 access denied for user. This error usually occurs when root@localhost wasn’t granted necessary rights a user tries to access PHPMyAdmin after successful installation of XAMPP(local server). Below-showed is the complete error message which appears on the screen.

resolve MYSQL Error 1045 Access Denied for user

There are several different servers that My SQL database use such as WAMP, XMAPP, LAMP, MAMP, etc. Different operating systems use these servers like Windows use WAMP, Linux use LAMP, All Mac OS use MAMP, and XAMPP supports all Operating Systems. Also, it supports mercury mail, Filezilla and some other scripts. In this article, I am going to provide basic simple techniques which a user can opt to get rid of this My SQL error access denied for user root@localhost on any of the local servers. But before moving further have a look upon the reasons for such my SQL issue.

Why  My SQL error 1045 access denied for user occurs?

Many times a user might encounter this error multiple times in his work. This issue occurs most of the times due to entering incorrect user-name or password. However, this is one of the reasons, but there might be other changes also by which the user may receive this MySQL error. Most of the time it looks identical but when we go into the deep study we came to know that multiple other factors are also contributing to this error. Let’s discuss the common reasons and work around them to solve this error.

Feasible reasons:

  • Type error: Incorrect user-name or password.
  • Accessing from the wrong host.
  • User doesn’t exist on the server.
  • A Mix of numeric and name-based hosts.

Methods to solve error 1045 access denied for user

I have come up with these easy methods to resolve the issue from the MySQL application. You can opt any of the methods and follow it correctly to fix MySQL error 1045 access denied for user.

#Method 1: Using cmd

  • Open command prompt window and access XAMPP directory: cd ../../Program/Files/xampp.
  • Now xampp>>mySQL>>bin.
  • Now run the command: mySQL.exe –user=root –password=.
  • This command starts command line and we can change -user=and -password=accordingly.

#Method 2: Creating a batch file

  • In the xampp folder create a file mySQL_command.bat and edit it with any text editor and paste it here:

@echo off

echoMySQL command line…

MySQL\bin\mySQL.exe –user=root –password=

pause

  • Save this file and modify user-name & password if you changed the username and password. Now run the command.bat and cmd will show with MySQL command line in running condition.

#Method 3: Configure file config.inc.php

  • localhost->xampp->phpmyadmin->config.inc.php
  • Open the file on any text editor.
  • Find this code code$cfg[‘Servers’][$i][‘password’] =”; MySQL password.
  • Now change the password which you have created earlier.
  • Click the Save button.

MySQL Database Recovery Software

If you are facing issues with the manual methods or unable to fix the issue by own then you can go for the automated method i.e using MySQL Database Recovery tool. This utility is designed to recover the valuable data from corrupt MySQL database. This advance tool helps to recover and save the maximum possible MySQL data in the form of a script or in a fresh database. 

To Sum Up

Manual methods need the user to be an expert in MySQL database commands. In this blog, I have told you the simple manual methods to fix MySQL error 1045 access denied for user. If you are able to do it yourself then go for them but if you are an IT expert or any issue occurs then you can try MySQL Database Recovery Software.

About The Author:

With more than five years of experience in email migration, Data Recovery, Email Backup, and File Management, I combine my years of experience with a strong interest in new technology. My professional journey is fueled by a genuine passion for navigating and mastering the latest advancements in these fields, ensuring that I stay ahead of the curve and bring innovative solutions to the table.

Related Post

© Copyrights 2017-2024 Database File Recovery. All Rights Reserved.