FreePBX 2.4.0.0, CentOS 5.2, retrieve_conf failed, config not applied

I just installed Asterisk and FreePBX on CentOS 5.2. To install FreePBX I’ve been following the instructions at this link

http://www.freepbx.org/support/documentation/installation/install-process-for-centos-5-1

I get to the point where I access FreePBX through the web browser and click the red bar to apply the configuration changes. When I do this I get the following error

retrieve_conf failed, config not applied

Reload failed because retrieve_conf encountered an error: 126
Added 2 minutes ago
(freepbx.RCONFFAIL)

When I try to run the retrieve_conf file from /var/lib/asterisk/bin. This is what I get.

./retrieve_conf

Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = amp111
Use of uninitialized value in string eq at /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl line 415.
DB Error: no such table

I am not sure what to change on line 415 of retrieve_op_conf_from_mysql.pl. Do I need to change anything. What am I doing wrong?

Jaysen