# MYSQL Application Not working on Asterisk 11

**URL:** <https://community.asterisk.org/t/mysql-application-not-working-on-asterisk-11/44873>\
**Category:** Asterisk Support\
**Created:** [January 3, 2014, 8:45pm UTC](https://community.asterisk.org/t/mysql-application-not-working-on-asterisk-11/44873 "2014-01-03T20:45:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 3, 2014, 8:45pm UTC](https://community.asterisk.org/t/mysql-application-not-working-on-asterisk-11/44873/1 "2014-01-03T20:45:09Z")

</div>

Hi,

I am new to Asterisk platform, have being using it for a couple of months, i tried to use MYSQL application on Asterisk 11 but i noticed the application is deprecated on make menuselect

xxx apps\_mysql,

I tried to copy apps\_mysql from previous add ons when i try to load it am getting an error

Anyway my purpose is to check whether dailed numbers are existing customers in the database and here is my extension.conf script.

exten =\> \_128,1,Answer()  
exten =\> \_128,n, MYSQL(Connect connid localhost root ila@123 asterisk)  
exten =\> \_128,n,Read(number,/home/ilhdlwlc,10,3,10)  
exten =\> \_128,n, MYSQL(Query resultid ${connid} SELECT tel from users where ${number})  
exten =\> \_128,n, MYSQL(Fetch fetchid ${resultid} telephone)  
exten =\> \_128,n,GotoIf($["${fetchid}" = “0”]?surahnotfound)  
exten =\> \_128,n,Dial(SIP/dialogic/${telephone})  
exten =\> \_128,n(surahnotfound),Playback(/etc/asterisk/sounds/extra/you-dialed-wrong-number)  
exten =\> \_128,n,Hangup()

If apps\_mysql application is deprecated is there any other methods to query the database.

---

<div class="post-metadata">

**Author:** ![navaismo](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/navaismo/32/2481_2.png) [@navaismo](https://community.asterisk.org/u/navaismo)\
**Post date:** [January 4, 2014, 12:57am UTC](https://community.asterisk.org/t/mysql-application-not-working-on-asterisk-11/44873/2 "2014-01-04T00:57:15Z")

</div>

In order to enable the deprecated app\_mysql you need to install the dependencies, if I recall you just need the mysql-devel library, then re run the configure script then select the app via menuselect and compile asterisk.

If you dont want to recompile asterisk switch to an AGI script to do that.
