Connecting to database..FAILED! I do not how solve this?

Hi all,

i lost my nerves, I installed asterisk and everything neccessary for freepbx, and when I run
./install_amp I gort next output

[[email protected] freepbx-2.1.0]# ./install_amp
Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking user…OK
Checking for /etc/amportal.conf…OK
Reading /etc/amportal.conf…OK
Checking for /etc/asterisk/asterisk.conf…OK
Reading /etc/asterisk/asterisk.conf…OK
Checking for Asterisk 1.2…OK
Checking for selinux…OK
Connecting to database…FAILED
Try running ./install_amp --username=user --password=pass (using your own user and pass)
[FATAL] Cannot connect to database

I used instruction from the link below

I do not know what to change in order to make this work.
When I enter my username and password for mysql database I got the sam output …
Is there anybody who has similar experience , to help me solve this problem ?


If you have a MYSql password set now reset to blank run the install and reset to whatever you wish…

Looks like maybe you missed this or did something wrong…

Quote from site …

Now, to configure the databases for freePBX:

[[email protected] ~]# cd /usr/src/freepbx-2.1.1
[[email protected] freepbx-2.1.1]# mysqladmin create asterisk
[[email protected] freepbx-2.1.1]# mysqladmin create asteriskcdrdb
[[email protected] freepbx-2.1.1]# mysql asterisk < SQL/newinstall.sql
[[email protected] freepbx-2.1.1]# mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

They also need to be secured, so that not just anyone can access them. freePBX will prompt you for a database password when you do the install. You need to pick that now. We’ll assume that you’ve picked ‘asteriskuser’ and ‘amp109’ - you probably shouldn’t use these, as they are well known passwords for [email protected] builds. If anyone’s trying to attack your machine, they will try this.

[[email protected] freepbx-2.1.1]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.16

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY ‘amp109’;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘amp109’;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
[[email protected] freepbx-2.0.1]

Now, after all of this, you need to pick a root ‘mysql’ password. For this, we’ll pretend it’s ‘s33kret’. If you need to do anything else with mysql, you’ll need to provide this password.

[[email protected] freepbx-2.1.1]# mysqladmin -u root password ‘s33kret’

follow this in order and it should work:

Hi to all,
I’ve the same problem during installation.
I did follow tips in the previous topic as well as in the INSTALL file.
All grant are setted for the default ‘asteriskuser’.

Anyone can tell me any suggestions?

Thanks 4 all