Elgg 1.8 Install Mysql Problem

I am trying to install Elgg on Debian. In Everything goes ok till i get to the database screen. I have setup a mysql DB and added the users. i have tested the connection from the CLI and it work fine but when Elgg tries to access it i get an error in the apache log that the host is unknown.

Any help appreciated.