Database access error after restore

Have a FreePBX 15 system that’s dead, just built a FreePBX Distro 16 system and restored a backup from the old system. Now getting:

Unable to connect to CDR Database using dsn ‘mysql:dbname=asteriskcdrdb;host=localhost;port=3306’ with user ‘freepbxuser’ and password ‘UehvdLzy3qHr’ - SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)::SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)

Found some old posts about this issue but the files mentioned there don’t seem to exist anymore. Where are the cdr db logins stored? or should I just fix it by changing the mysql password for the freepbxuser in the cdr database. If so, what’s the proper query? I’m sure it has some kind of hash command to encrypt the password.

This can be found in Settings > Advanced Settings

that would be great if I could get to the gui… but I cant.

Tried issuing a set password for ‘freepbxuser’@localhost = password(“password”);

where ‘password’ is the one found in /etc/freepbx.conf but that didn’t work either.

They can be updated via mysql:

select * from freepbx_settings where keyword like 'CDR%';

But if you’re restoring to a new server, did you put the old AMPDBPASS from the original server into /etc/freepbx.conf?

I don’t think you understand the situation. I have no access to the old server or it’s data other than a backup from last month. I can’t check the old passwords or settings.

after changing the password as stated above I now get this:

SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)::SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)

So whatever you set the password to in mysql, make sure it is reflected in freepbx.conf and in the freepbx_settings table

update freepbx_settings set value="password" where keyword like 'CDRDBPASS';

then

fwconsole reload
1 Like

Thanks @adell4444!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.