<p>MySQL returns ER_ACCESS_DENIED_NO_PASSWORD_ERROR when a connection attempt uses an account without a defined password or with an empty password string.</p>
<p>MySQL Error 1698: ER_ACCESS_DENIED_NO_PASSWORD_ERROR occurs when you try to connect with a user that has no password set or the server forbids passwordless logins. Set a secure password or update authentication settings to resolve the issue.</p>
Access denied for user '%s'@'%s'
Error 1698 signals that MySQL has rejected the connection because the specified account lacks a valid password. The server blocks passwordless access when its authentication plugin or configuration requires credentials.
The message format is: Access denied for user 'user'@'host'. It surfaces during CLI logins, application startups, and GUI connections when the password field is empty or NULL.
The error appears when the mysql.user table stores an empty authentication_string for the account while the server enforces password validation. It also arises if the client omits the password flag during connection.
Default Ubuntu and MariaDB packages often create system accounts that must use the UNIX_SOCKET plugin, leading to this denial when attempting password-based logins.
Set a strong password for the affected account, or configure the account to use its intended authentication plugin. Use ALTER USER with IDENTIFIED BY for standard passwords, or switch to mysql_native_password if needed.
If the account should be socket authenticated, log in with sudo mysql, then either add a password or create a separate user for remote access.
Ubuntu root user fails with mysql -u root -p: remove the -p flag because the root account authenticates via the system socket. Application containers fail: create a dedicated user with password and GRANT privileges.
CI pipelines break after MySQL upgrade: ensure the pipeline sets MYSQL_ROOT_PASSWORD or uses an account that matches the new auth policy.
Always create named service accounts with explicit passwords. Avoid reusing the root account in application code. Store credentials in environment variables or secret managers.
Regularly audit the mysql.user table for empty authentication_string values and enforce strong password policies with the validate_password plugin.
ER_ACCESS_DENIED_ERROR (1045) occurs when the password is wrong rather than missing. ER_DBACCESS_DENIED_ERROR (1044) triggers when the user lacks database privileges. Fix them by correcting credentials or granting permissions.
The user entry exists but the authentication_string column is blank, leaving MySQL with no password to validate.
Default installations on Debian or Ubuntu create root@localhost that authenticates through unix_socket. Supplying a password triggers the error.
Scripting tools or humans forget to pass -p or MYSQL_PWD, so MySQL attempts a passwordless login and fails.
A DBA enabled validate_password or caching_sha2_auth, prohibiting accounts without secure passwords.
After restoring a dump, authentication plugins mismatch current server defaults, leaving some users without valid passwords.
Triggers when the supplied password is incorrect. Resolve by resetting the password or verifying credentials.
Occurs when the user lacks privileges on the requested database. Grant required rights with GRANT statements.
Happens when the host portion of the user account does not match the connecting client. Add a specific host entry or use '%'.
Only in tightly controlled environments. Use socket or SSL certificates rather than empty passwords for better security.
Ubuntu installs MySQL with the root account using the unix_socket plugin, delegating authentication to the operating system rather than a password.
Pass MYSQL_ROOT_PASSWORD or MYSQL_USER and MYSQL_PASSWORD as environment variables when starting the container, or run ALTER USER after the container launches.
Galaxy stores encrypted credentials per connection and warns if you attempt to connect with an empty password, reducing the chance of this authentication failure.