0
I'm trying to get a PHP script to connect to Asterisks internal sql database.
I tried the to use the standard method for example
$con = mysqli_connect("192.168.1.126","root","mysql","asterisk");
However when I log into the asterisk server to access the mysql database all I need it to type "mysql" and I'm logged in.
Im wondering is it possible for my php script to connect to asterisk internal database.
//edit The following mysql error is shown
Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on '192.168.1.126' (111) in /var/www/html/project/sipSubScript.php on line 6
Failed to connect to MySQL: Can't connect to MySQL server on '192.168.1.126' (111)
Can you do it from CLI? https://sites.google.com/site/bantisandy/home/asterisk/asmysql-database
– krowe – 2014-08-24T02:37:56.123Also, check this: http://stackoverflow.com/questions/5864242/how-to-test-which-port-mysql-is-running-on-and-whether-it-can-be-connected-to
– krowe – 2014-08-24T02:39:37.230@Bilbo: Did you checked connection to MySQL server from any MySQL client software apart from connecting to it through code? – Renju Chandran chingath – 2014-08-24T03:59:44.837
Ya I tried connecting through the command line. I also tried telnet. I can connect locally using the command line, but when i try from another machine it wont work. My other machine is also on the local network. Thanks for the replies guys – Bilbo – 2014-08-24T04:30:34.453