When restoring FreePBX from backup, you may find the CDR database is not updated. This is because the cdr_mysql.conf file is not overwritten by the restore, and so the password for the CDR database is incorrect.
You can resolve it like this:
SSH onto the server
Find the lines:
$amp_conf['AMPDBUSER'] = 'freepbxuser';
$amp_conf['AMPDBPASS'] = '3098SADFSLa';
Copy the password, quit nano
Insert the password in the apropriate section
Save the file, quit nano
You may need to restart the server to allow the password to be updated.