What elastix version do you have installed? If it is not 2.4 or higher, you have to edit config.php on fop2manager and set the correct mysql user/pass, etc. This come straight from fop2manager README file:
VANILLA ASTERISK INSTALLATION
-----------------------------
If you do not use FreePBX, you should also create a MySQL database
and set proper credentials in config.php.
You can create a database named fop2 with the command:
mysqladmin -u root -p create fop2
You will be prompted for the mysql root password that you must know
beforehand.
Then create a user to access that database:
mysql -u root -p -e "GRANT all privileges ON fop2.* TO fop2user@localhost identified by 'somepassword'"
That command will create a mysql user named 'fop2user' with password
'somepassword'
So, your config.php should look like this:
$DBHOST="localhost";
$DBUSER="fop2user";
$DBPASS="somepwassord";
$DBNAME="fop2";