root@obsidian:/usr/src/freepbx# ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: asteriskuser
Using password: *****************
Checking user..OK
Checking if Asterisk is running..running with PID: 4622..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [obsidian]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [mypass]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [mypass]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [asteriskuser]
amp_conf [AMPDBPASS] => [mypass]
amp_conf [AMPWEBADDRESS] => [192.168.1.2]
amp_conf [AMPDBNAME] => [asterisk]
amp_conf [ASTETCDIR] => [/etc/asterisk]
amp_conf [ASTMODDIR] => [/usr/lib/asterisk/modules]
amp_conf [ASTVARLIBDIR] => [/var/lib/asterisk]
amp_conf [ASTAGIDIR] => [/var/lib/asterisk/agi-bin]
amp_conf [ASTSPOOLDIR] => [/var/spool/asterisk]
amp_conf [ASTRUNDIR] => [/var/run/asterisk]
amp_conf [ASTLOGDIR] => [/var/log/asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..12.8.0
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
root@obsidian:/usr/src/freepbx#
I’ve also run the command with the password from amportal.conf with no success. I’m really out of ideas here. I’ve been looking for a solution for hours straight.
I saw a post similar to this from October, but is a full reinstall really the only way to fix this?
Any help would be greatly appreciated.
What happens when youmysql -u asteriskuser -ppassword
Example with password being “nospaceafterdashp”
If not, while logged in as root, just type “mysql” and
USE mysql;
UPDATE user SET Password='newpassword' WHERE User='asteriskuser';
flush privileges;
Alternatively, I’d try the whole sequence from the install guide:
cd /usr/src/freepbx
export ASTERISK_DB_PW=amp109
mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "flush privileges;"
Any of these steps could potentially break something, and I am not responsible if you run them and they do. That said, I think you’re safe Can’t be any more broken than it is right now, right?
root@obsidian:/usr/src/freepbx# mysql -u asteriskuser -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 348
Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
I’ve tried going over the steps again, but no luck.
I’ve tried it both ways multiple times. Should I remove mysql along with the databases and users? Would that give me a fresh enough environment to try it over again?
At this point, I’m pretty confident that it sin’t the password. Basically, everything that’s been suggested so far, I’ve already tried with just as much success. And I really appreciate the help, guys.
root@obsidian:/usr/src/freepbx# ./install_amp --installdb --username=asteriskuser --password=amp109
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: asteriskuser
Using password: ******
Checking user..OK
Checking if Asterisk is running..running with PID: 6431..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [obsidian]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [asteriskuser]
amp_conf [AMPDBPASS] => [amp109]
amp_conf [AMPWEBADDRESS] => [192.168.1.2]
amp_conf [AMPDBNAME] => [asterisk]
amp_conf [ASTETCDIR] => [/etc/asterisk]
amp_conf [ASTMODDIR] => [/usr/lib/asterisk/modules]
amp_conf [ASTVARLIBDIR] => [/var/lib/asterisk]
amp_conf [ASTAGIDIR] => [/var/lib/asterisk/agi-bin]
amp_conf [ASTSPOOLDIR] => [/var/spool/asterisk]
amp_conf [ASTRUNDIR] => [/var/run/asterisk]
amp_conf [ASTLOGDIR] => [/var/log/asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..12.8.0
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
root@obsidian:/usr/src/freepbx#
Edit: Just in case this it a problem, there was a password for the root mysql account, but I removed it yesterday. I don’t know why that would still be interfering, but I’m running out of ideas.
Thank you so much! I thought that this might be an issue, so yesterday I went into webmin and allowed it to accept form any host, but that didn’t work. I guess I was on the right track, but i gave up on that idea too soon. Again, thanks for all the help
Dicko and I will flay ourselves appropriately for missing this in the original post Or maybe Dicko, we can flay each other? :trollface:
The problem wasn’t that the connection was getting rejected (fix it to only accept local connections, btw, 127.0.0.1), it’s that the client portion of the script couldn’t resolve it and as such couldn’t connect.