Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →The MySQL message ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) means the client attempted to authenticate as root from localhost without sending a password. Start with mysql -u root -p, then enter the password assigned to that installation. If that fails, check whether the connection is using the intended host transport, whether an option file is supplying unexpected defaults, and whether phpMyAdmin is using credentials that match MySQL.
What “using password: NO” actually means
The phrase describes the login attempt that MySQL received: no password was supplied by the client. It does not establish that the correct password is blank, and it does not prove that the account has no password. A MySQL installation may have assigned a root password during setup even when the command you ran did not visibly include one.
As an Amazon Associate I earn from qualifying purchases.
MySQL returns error 1045 (SQLSTATE 28000) when authentication for the requested account and host is rejected. In this case, the requested account is root and the client identifies the connection as coming from localhost. The server evaluates the user-and-host combination, authentication method and supplied credentials together.
Check which situation applies before changing anything
| Situation | What to try first | Important qualification |
|---|---|---|
| The root password is known | mysql -u root -p |
Enter the password at the hidden prompt; do not append it as an ordinary argument. |
| The installation is intentionally configured with a blank root password | Run the prompt command and submit an empty response | Use an empty response only when you have verified that this is the installation’s configuration. |
| You are unsure which host transport is being used | Test localhost and 127.0.0.1 explicitly |
They commonly use different transports and can match different account rows. |
| An option file or environment setting may be changing defaults | Make one diagnostic attempt with --no-defaults |
Correct the unexpected configuration after testing instead of bypassing it permanently. |
| The root password is forgotten | Use the reset procedure for your installed MySQL version and operating system | Recovery commands differ; an old recipe may be unsafe or incompatible with a current server. |
| phpMyAdmin or an XAMPP interface shows the error | Align its authentication mode and stored credentials with the MySQL account | After a password change, the interface must be updated or set to prompt for the current password. |
Fix a known password from the command line
1. Invoke the password prompt correctly
- Open a terminal, Command Prompt or the shell supplied by your local MySQL stack.
- Run:
mysql -u root -p - When
Enter password:appears, type the password and press Enter. Characters normally remain invisible while you type.
The short option -p and the long option --password request password handling. They are not equivalent to typing the word password as a separate command argument. Supplying a bare word does not turn it into a password option and can leave the client attempting a password-less login.
#1 Best Overall
If the installation is documented as having a blank root password, submit an empty response at the prompt. Do not assume that a blank response is correct merely because you never chose a password yourself; installers and packaged stacks can assign one during setup.
2. Distinguish a wrong password from a password that was never sent
A retry with -p changes the client behavior: it asks you for a value instead of sending no password. If the command then reports an authentication failure, verify the exact password, keyboard layout and the server instance you intended to reach. Do not repeatedly change credentials until you have established which server and account are being contacted.
Test localhost and 127.0.0.1 separately
localhost and 127.0.0.1 both refer to the local computer, but they commonly request different connection transports. A localhost connection generally uses a local socket or named pipe, while 127.0.0.1 requests TCP. MySQL can match those connections to different rows in its account table, so a password that works for one host entry may fail for the other.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchForce a TCP test
- Run:
mysql --host=127.0.0.1 -u root -p - Enter the same known password at the prompt.
- Compare the result with the original
localhostcommand.
If the explicit TCP attempt works but the localhost attempt does not, the problem is likely tied to the account row or authentication path selected for the local socket or named pipe. If the reverse is true, the TCP-specific account entry or server listener may be the one that needs attention. The account must exist for the exact user-and-host combination used by the connection.
When diagnosing a local development stack, write down the host value used by each application, command and interface. Changing only the host name can change which MySQL account definition is evaluated.
Rule out option-file and environment overrides
MySQL clients read configuration from option files and may also receive settings from the environment or from a wrapper supplied by a local stack. Those settings can inject a username, host, port or password behavior that is not visible in the command you typed. This is one reason an error can say using password: NO even when you thought a password should have been used.
Make a clean diagnostic attempt
- Run the client while suppressing option-file defaults:
mysql --no-defaults -u root -p - Enter the password at the prompt.
- If necessary, repeat with an explicit TCP host:
mysql --no-defaults --host=127.0.0.1 -u root -p
This test is diagnostic, not a permanent configuration strategy. If the clean command succeeds, inspect the option files used by your operating system, MySQL installation or development stack. Look for entries that set a different user, host or password-related option. Remove or correct the stale value, then retry the normal command without --no-defaults.
Keep the clean and normal results separate in your notes. A success with --no-defaults proves that a loaded default is affecting the attempt; it does not identify which file or line is responsible by itself.
If the root password is forgotten
Do not copy a password-reset command from an unrelated MySQL release. The supported recovery sequence depends on the server version, operating system, service-management method and authentication configuration. MySQL’s own manual provides version-appropriate root-password reset procedures.
Prepare before starting recovery
- Identify the installed MySQL server version, not just the version of a client binary on your path.
- Identify the operating system and whether MySQL runs as a service, through a bundled stack or from a manually started process.
- Confirm that you can stop and start the relevant server instance with the required administrative permissions.
- Record the data directory and configuration being used so that you reset the intended instance rather than another local server.
Use the matching manual procedure
- Open the MySQL documentation for your server version and operating system and select its root-password reset method.
- Follow the procedure’s instructions for stopping the server and starting the temporary recovery mode, if that method requires it.
- Set a new root credential using the commands specified for that version.
- Return the server to its normal startup mode and verify that it is running normally.
- Test the new credential with
mysql -u root -p, then test the host form your application actually uses.
Older instructions that rely on a PASSWORD() expression may not apply to a current installation. Treat a reset as a controlled maintenance operation: use the exact syntax and sequence for the installed release, and avoid editing authentication tables by guesswork.
Fix phpMyAdmin and XAMPP login mismatches
phpMyAdmin is a client interface; it does not create a separate MySQL password. It must authenticate with the account and host details accepted by the MySQL server. A command-line login can therefore work while phpMyAdmin still reports access denied, or the reverse, when the two clients use different hosts, authentication modes or stored credentials.
When the password is known
- Confirm the account and host that work from the command line, using the explicit commands above.
- Open the phpMyAdmin configuration supplied by your local stack.
- Choose an authentication mode that prompts for the current credentials, such as cookie authentication, or update the stored credentials so they exactly match the MySQL account.
- Sign out of phpMyAdmin, close any stale browser session and sign in again.
Cookie authentication is useful after a password change because phpMyAdmin asks for the current password instead of continuing to submit an old value saved in its configuration.
Rank #4
When the password was reset
- Complete and verify the server-side reset first.
- Update the phpMyAdmin setting that supplies the old password, or switch to cookie authentication so the interface prompts you.
- Ensure the configured host matches the account entry that succeeded in your command-line test. A setting for
localhostcan behave differently from one for127.0.0.1. - Retry after restarting the relevant local stack components if they cache connection settings.
Do not “fix” the interface by making the MySQL account blank-password when the server was intended to require a password. Make the client configuration agree with the account instead.
Read the result of each test
| Test result | Likely direction | Next action |
|---|---|---|
mysql -u root -p succeeds |
The account and local transport accept the entered password. | Update any application or phpMyAdmin configuration that still submits no password or an old one. |
| The prompt appears, but authentication fails | The supplied credential, account row, host or server instance does not match. | Verify the password, test 127.0.0.1, and confirm the intended server version and instance. |
--no-defaults succeeds while the normal command fails |
A loaded option file or environment setting is changing the request. | Inspect and correct the relevant default rather than permanently bypassing all defaults. |
TCP succeeds but localhost fails |
The socket or named-pipe path is matching a different host entry or configuration. | Check the account row and local transport used by the application. |
| Both command forms fail and the password is unknown | A credential reset is required. | Use the manual procedure for the installed MySQL version and operating system. |
| Command line succeeds but phpMyAdmin fails | The interface is submitting different credentials, host details or authentication mode. | Use cookie authentication or align its configuration with the working command. |
Common mistakes that recreate error 1045
Typing a password as a bare argument
mysql -u root password does not mean “log in with the password password.” Use -p or --password to invoke password handling, preferably with an interactive prompt.
Assuming “NO” proves the password should be blank
The suffix reports what the client sent on that attempt. It does not reveal the password configured on the server. An installer-assigned password or an option-file override can exist even when your command omitted one.
Changing the account without checking the host
MySQL account entries include a host component. Altering credentials for one host entry does not necessarily change the entry selected by a connection using another transport.
Best Value
Applying a reset recipe from another release
Authentication and recovery details vary by MySQL version and operating system. Use the procedure written for the server you actually run.
Updating only phpMyAdmin
phpMyAdmin cannot repair a rejected server credential by itself. First establish a working MySQL login, then make the interface submit the same account, host and password.
After the login works
Repeat the successful test using the exact connection form your application needs. If it uses localhost, test that spelling; if it uses 127.0.0.1, test TCP explicitly. This catches a host-row mismatch before you move the credentials into application configuration.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Remove stale passwords from local client configuration files and replace them with the current value only where the client requires it.
- Keep the host setting consistent across your command line, phpMyAdmin and application.
- Restart the local service or stack component when it caches connection settings.
- Record the server version and the working command so future password recovery uses the correct manual instructions.
A successful command-line login confirms only that one account, host and transport combination authenticated. It does not automatically validate every local application or interface configuration.
Quick Recap
As an optional shortcut after trying the manual steps, Outbyte PC Repair can look for common Windows problems, clean temporary and cache files, check selected Windows settings and missing updates, and provide an app-crash log. It complements antivirus software rather than replacing it; results vary, and no tool repairs every crash. It runs on Windows 11, 10, 8 and 7, with a free trial by category for at least two days before a paid subscription.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

