SQLSTATE [HY000] [1045] Access denied

If you aren't speaking german, you can ask for support or post your request here.
Antworten
drareve
Beiträge: 7
Registriert: 5. Sep 2020, 17:15

SQLSTATE [HY000] [1045] Access denied

Beitrag von drareve »

The problem occurred when the password was changed for the mySQL user. Any connection by Admidio results in
SQLSTATE[HY000] [1045] Access denied for user 'valid_username'@'localhost' (using password: YES)

The ../adm_my_files/config.php was changed to have the same new password and contains values
$g_adm_srv = 'localhost'; // Host
$g_adm_port = null; // Port
$g_adm_db = 'valid_database_name; // Database-Name
$g_adm_usr = 'valid_username'; // Username
$g_adm_pw = 'valid_password'; // Password

And when I use from linux CLI from localhost "mysql valid_database_name -u valid_username -p" and the new password I successfully connect to the database, proving the credentials are valid.

The /adm_my_files/logs show .....
[2021-08-16 16:33:45.696788] Admidio.ALERT: DATABASE: Could not connect to Database! EXCEPTION MSG: SQLSTATE[HY000] [1045] Access denied for user 'valid_username'@'localhost' (using password: YES) {"engine":"mysql","host":"localhost","port":null,"dbName":"valid_database_name","username":"valid_username","password":"******","options":[]} {"file":"/home/customer/www/member.sasac.co.uk/public_html/adm_program/system/classes/Database.php","line":231,"class":"Database","function":"connect"}

It appears like the values in ./adm_my_files/config.php are not being read so I changed both the username and password to another valid account and retried.

The logs showed the same denial message but for the new username and no longer update even though the values in config.php were restored.

What is the easiest way to restart the application and reread the configuration?
Benutzeravatar
fasse
Administrator
Beiträge: 6041
Registriert: 12. Nov 2005, 16:06

Re: SQLSTATE [HY000] [1045] Access denied

Beitrag von fasse »

You could restart your browser. After that a new session should be created and the new data of the config file should be read.
drareve
Beiträge: 7
Registriert: 5. Sep 2020, 17:15

Re: SQLSTATE [HY000] [1045] Access denied

Beitrag von drareve »

Hi. That is what I had expected. But no joy. I am trying to avoid a reinstallation. Any other suggestions?
Benutzeravatar
fasse
Administrator
Beiträge: 6041
Registriert: 12. Nov 2005, 16:06

Re: SQLSTATE [HY000] [1045] Access denied

Beitrag von fasse »

Hmm that sounds strange. Could it be that localhost is the wrong url for the database because your ftp is on another server than the database?
Antworten