Home Forums HAast (High Availability for Asterisk) Configuration & Optimization FreePBX access denied to SQL error on one node

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Customer Inquiry
    Member
    Post count: 197

    I am using Telium’s High Availability for Asterisk (HAAst) clustering software. On one of my HAAst nodes I am getting this FreePBX error:


    Exception: SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES)::SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES) in file /var/www/html/admin/libraries/utility.functions.php on line 204
    Stack trace:
    1. Exception->() /var/www/html/admin/libraries/utility.functions.php:204
    2. die_freepbx() /var/www/html/admin/libraries/BMO/Database.class.php:142
    3. PDOException->() /var/www/html/admin/libraries/BMO/Database.class.php:137
    4. PDO->__construct() /var/www/html/admin/libraries/BMO/Database.class.php:137
    5. FreePBXDatabase->__construct() /var/www/html/admin/libraries/BMO/FreePBX.class.php:71
    6. FreePBX->__construct() /var/www/html/admin/bootstrap.php:153
    7. require_once() /etc/freepbx.conf:11
    8. include_once() /var/lib/asterisk/bin/fwconsole:12
    Exception: SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES)::SQLSTATE[HY000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES) in file /var/www/html/admin/libraries/utility.functions.php on line 204

    This is a new installation, and everything was working great for a few weeks. I tweaked some settings in FreePBX recently and then something broke. What did I do wrong and how do I fit it? Is HAAst malfunctioning?

    Telium Support Group
    Member
    Post count: 258

    The problem most likely was created by changing the FreePBX database username/password on one node and not the other. Changing the FreePBX database username/password does two things: 1. it updates the /etc/freepbx.conf file, and 2. it updates the ‘users’ table in the MySQL ‘mysql’ database.

    So although you may be syncing the ‘freepbx’ database between nodes, you are not syncing the ‘mysql’ database between nodes. And you should not try to synchronize the MySQL ‘mysql’ database (which holds the schema as well as user info), unless you are a DBA and really understand what you are doing!

    The solution to this problem is very simple:

    • Copy the full MySQL database from the working node to the problem node; or,
    • Reset the FreePBX user password on the problem node to match the working node; or,
    • Don’t sync the freepbx.conf file and set the two nodes to have different passwords

    To avoid this in the future either:

    • set the FreePBX MySQL user password identically on both systems; or
    • leave the default password; or
    • don’t synchronize the freepbx.conf file; or,
    • sync the ‘mysql’ database (but you have to be sure you understand the implications before doing so) – we don’t recommend this

    So the cause and solution to this problem reside completely within FreePBX (HAAst has not malfunctioned in any way).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.