Connecting to database..FAILED

during installation i got:

Connecting to database…FAILED
[FATAL] mysql PHP libraries not installed

any ideas?

You have to do this

Before you can do anything to MySQL, you need to make sure it’s running:
[email protected]:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld.
[email protected]:~#

Now, you must cd to the /usr/src directory and get the source to freepbx using svn:
[email protected]:/usr/src/freepbx# cd /usr/src/
[email protected]:/usr/src# svn co https://svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2 freepbx-2.2
A freepbx/amp_conf
A freepbx/amp_conf/astetc
… freePBX now downloads …
Checked out revision 2574.
[email protected]:/usr/src# cd /usr/src/freepbx-2.2

Now, to configure the databases for freePBX:

[email protected]:/usr/src/freepbx# mysqladmin create asterisk
[email protected]:/usr/src/freepbx# mysqladmin create asteriskcdrdb
[email protected]:/usr/src/freepbx# mysql asterisk < SQL/newinstall.sql
[email protected]:/usr/src/freepbx# 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]:/usr/src/freepbx# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.0.22-Debian_0ubuntu6.06.2-log

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

mysql> GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘amp109’; (This is the first username and password asked for below)
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* 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
Bye
[email protected]:/usr/src/freepbx#

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]:/usr/src/freepbx# mysqladmin -u root password ‘s33kret’

did you install mysql and php when you installed centos?

try typing at the command link

yum -y install gcc libxml2-devel libtiff-devel mysql-server php-gd php-mbstring mysql-devel php-mysql

hi every body as i am new to freepbx i also got same problem on linux 9 issue was resolved as you menstion by installing these php librariers . now i get this message " Connecting to database…FAILED
Try running --username=user --password=pass (using your own user and pass) how i should change the user id & password .

Regards

Hello, everyone

My installation is the same.
When run ./install_amp, it shows as below. I use centos 5.0, and installed mysql. What will cause this problem? How to solve it?

[[email protected] freepbx-2.2.1]# ./install_amp
Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking user…OK
Checking for /etc portal.conf…OK
Reading /etc portal.conf…OK
Checking for /etc/asterisk/asterisk.conf…OK
Reading /etc/asterisk/asterisk.conf…OK
Using asterisk as PBX Engine
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

Best Regards,
Sam

I’m very new to asterisk and freePBX, I’ve done most of the s/w update and installed the asterisk v1.4.17 on to my Red Hat Enterprise Linux Client release 5 (Tikanga). The Kernel version is 2.6.18-8.1.4.el5.

I’ve followed these sites for my installation process:
http://aussievoip.com.au/wiki/freePBX-Centos
http://voip-info.org/wiki/index.php?page=Asterisk+Starting+and+Stopping
http://www.asteriskguru.com/tutorials/asterisk_installation_compilation_fedora.html

I’ve seen this line from: http://aussievoip.com/wiki/index.php?page=freePBX-Ubuntu

“it means that you haven’t done the ‘GRANT ALL PRIVILEGES …’ command in MySQL, or, you’ve put the wrong password in when you were doing the installation. All is not lost. If you want to re-run the installation, with it prompting you again, you can simply delete the /etc/amportal.conf file (rm /etc/amportal.conf) or edit it and put the correct password in. Then re-run ./install_amp and it should proceed along happily.”

So made sure that the GRANT ALL PRIVILEGES has been executed properly.

Still I’m encountering the same Connecting to database…FAILED error. Can anybody help me what I’m doing wrong?

Please do not hijack a existing thread about one thing with another topic. It is the fastest way to NOT get a answer as the topic of the first message is what is shown when looking for new messages and your posting has nothing to do with that subject. So the people who could help will not see it. Also the author of the initial notice probably has notification alerts enabled (the default) so now you are “spamming” him with non-relevant information to his original posting.

Please post this as a new thread.

Also take a look at the installation instructions on this site for Red Hat and/or CentOS as they are probably the best source for directions on installing FreePBX.