Let's say your mySQL or MariaDB error log contains the following warning.
Access denied for user 'john.doe'@'server1.example.com' (using password: YES)
Notice in this example that access is denied for user john.doe. If you have root access to mySQL or MariaDB, ensure John Doe's user account exists. Notice in this example that john.doe has access to host %. The % character means that john.doe is allowed to make remote connections to mySQL or MariaDB.
~]# mysql -e "select User,Password,Host from mysql.user where User = 'john.doe'\G"
*************************** 1. row ***************************
User: john.doe
Password: *964A30F03EBE2D0D8EADC172640E4389BC9AF7FF
Host: %
Notice that the hashed password in this example is 964A30F03EBE2D0D8EADC172640E4389BC9AF7FF. If you know what the user's password is supposed to be, the select password command can be used to verify the users password matches the hashed password.
~]# mysql -e "select password('itsasecret')"
+-------------------------------------------+
| password('itsasecret') |
+-------------------------------------------+
| *964A30F03EBE2D0D8EADC172640E4389BC9AF7FF |
+-------------------------------------------+
If the password is incorrect, you can updated the password.
mysql -e "update mysql.user SET Password=PASSWORD('itsasecret') where User='john.doe'"
mysql -e "update mysql.user SET authentication_string=PASSWORD('itsasecret') where User='john.doe'"
And then flush privileges.
mysql -e "FLUSH PRIVILEGES"