# Asterisk real time(error)

**URL:** <https://community.asterisk.org/t/asterisk-real-time-error/10467>\
**Category:** Asterisk Support\
**Created:** [November 14, 2006, 10:52am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467 "2006-11-14T10:52:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali\_raja](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ali\_raja](https://community.asterisk.org/u/ali_raja)\
**Post date:** [November 14, 2006, 10:52am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/1 "2006-11-14T10:52:49Z")

</div>

hi

i m getting following error while configuring asterisk realtime with Mysql

```auto
Nov 14 03:29:53 ERROR[6448]: res_config_mysql.c:651 mysql_reconnect: MySQL RealTime: Failed to connect database server asterisk on "localhost" (err 2005). Check debug for more info.
Nov 14 03:29:53 NOTICE[6448]: chan_sip.c:12487 reload_config: Unable to load config sip.conf
```

my configuration for extconfig.conf are as under

```auto
sip.conf => mysql,asterisk,sip_m
```

my configuration for res\_mysql.conf

```auto
[general]
dbhost = "localhost"
dbname = asterisk
dbuser = myuser
dbpass = mypass
dbport = 3306
dbsock = /tmp/mysql.sock
```

i would be thankful to u…

---

<div class="post-metadata">

**Author:** ![baconbuttie](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/baconbuttie/32/916_2.png) [@baconbuttie](https://community.asterisk.org/u/baconbuttie)\
**Post date:** [November 14, 2006, 11:02am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/2 "2006-11-14T11:02:19Z")

</div>

as the message says … check debug for more info. turn on debug logging and see if it really does give you more.

i take it you’ve checked the MySQL server is actually running ?

---

<div class="post-metadata">

**Author:** ![ali\_raja](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ali\_raja](https://community.asterisk.org/u/ali_raja)\
**Post date:** [November 14, 2006, 1:27pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/3 "2006-11-14T13:27:37Z")

</div>

yah mysql server is running. and i had made following change aswell but its still displaying same error…changes i have made r as under

```auto
res_mysql.conf

[general] 
dbhost = 127.0.0.1
dbname = asterisk 
dbuser = root
dbpass = 1223
dbport = 3306 
dbsock = /var/run/mysqld/mysqld.sock 

```

---

<div class="post-metadata">

**Author:** ![baconbuttie](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/baconbuttie/32/916_2.png) [@baconbuttie](https://community.asterisk.org/u/baconbuttie)\
**Post date:** [November 14, 2006, 1:50pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/4 "2006-11-14T13:50:39Z")

</div>

the debug log ? have you tried connecting from the console using mysqladmin with those credentials and host details ?

---

<div class="post-metadata">

**Author:** ![ali\_raja](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ali\_raja](https://community.asterisk.org/u/ali_raja)\
**Post date:** [November 15, 2006, 1:32pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/5 "2006-11-15T13:32:34Z")

</div>

here is the result of debug reload

```auto
Reloading SIP
Nov 15 18:03:40[b] DEBUG[/b][5404]: res_config_mysql.c:405 config_mysql: MySQL RealTime: Static SQL: SELECT category, var_name, var_val, cat_metric FROM sip_m] WHERE filename='sip.conf' and commented=0 ORDER BY filename, cat_metric desc, var_metric asc, category, var_name, var_val, id
    -- Reloading module 'codec_gsm.so' (GSM/PCM16 (signed linear) Codec Translator)
  == Parsing '/etc/asterisk/codecs.conf': Found
Nov 15 18:03:40 ERROR[5404]: res_config_mysql.c:651 mysql_reconnect: MySQL RealTime: Failed to connect database server asterisk on 127.0.0.1 (err 2003). Check debug for more info.
Nov 15 18:03:40 ERROR[5404]: res_config_mysql.c:651 mysql_reconnect: MySQL RealTime: Failed to connect database server asterisk on 127.0.0.1 (err 2003). Check debug for more info.
Nov 15 18:03:40[b] DEBUG[/b][5404]: res_config_mysql.c:652 mysql_reconnect: MySQL RealTime: Cannot Connect (2003): Can't connect to MySQL server on '127.0.0.1' (111)
Nov 15 18:03:40 NOTICE[5404]: chan_sip.c:12487 reload_config: Unable to load config sip.conf
Nov 15 18:03:40 NOTICE[5404]: chan_sip.c:12487 reload_config: Unable to load config sip.conf
```

i hav’nt tried it from mysql admin… ❓

---

<div class="post-metadata">

**Author:** ![pbrunnen](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pbrunnen](https://community.asterisk.org/u/pbrunnen)\
**Post date:** [November 16, 2006, 7:28pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/6 "2006-11-16T19:28:38Z")

</div>

Asterisk is unable to connect to your database.

1. Check you mysqld.sock path…

2. Use the mysql command line utility to verify the username and password is correct. ‘mysql -u USERNAME -p’ You will be prompted for a password.

3. Make sure you have flushed privileges in mysql to ensure that your user is loaded from the table.

I bet you it is one of those…  
-Cheers, Peter.

---

<div class="post-metadata">

**Author:** ![808blogger](https://avatars.discourse-cdn.com/v4/letter/8/b5e925/32.png) [@808blogger](https://community.asterisk.org/u/808blogger)\
**Post date:** [November 17, 2006, 3:12am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/7 "2006-11-17T03:12:44Z")

</div>

maybe you need to set the password with with OLD\_PASSWORD flag? (for your mysql user)

mysql\> SET PASSWORD FOR  
-\> ‘some\_user’@‘some\_host’ = OLD\_PASSWORD(‘newpwd’);

---

<div class="post-metadata">

**Author:** ![ali\_raja](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ali\_raja](https://community.asterisk.org/u/ali_raja)\
**Post date:** [November 17, 2006, 7:32am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/8 "2006-11-17T07:32:56Z")

</div>

thanks for reply…i follow ur suggestions and now its seems a bit better…and now i got this reply.

\*CLI\>  
Nov 17 11:13:11  
DEBUG[3113]: res\_config\_mysql.c:674 mysql\_reconnect: MySQL RealTime: Everything is fine.  
Nov 17 11:13:11 WARNING[3113]: res\_config\_mysql.c:415 config\_mysql: MySQL RealTime: Failed to query database. Check debug for more info.  
Nov 17 11:13:11 WARNING[3113]: res\_config\_mysql.c:415 config\_mysql: MySQL RealTime: Failed to query database. Check debug for more info.

Nov 17 11:13:11 DEBUG[3113]:  
res\_config\_mysql.c:416 config\_mysql: MySQL RealTime: Query: SELECT category, var\_name, var\_val, cat\_metric FROM sip\_budd WHERE filename=‘sip.conf’ and commented=0 ORDER BY filename, cat\_metric desc, var\_metric asc, category, var\_name, var\_val, id

Nov 17 11:13:11 DEBUG[3113]:  
res\_config\_mysql.c:417 config\_mysql: MySQL RealTime: Query Failed because: Unknown column ‘category’ in 'field list’  
Nov 17 11:13:11 NOTICE[3113]: chan\_sip.c:12487 reload\_config: Unable to load config sip.conf  
Nov 17 11:13:11 NOTICE[3113]: chan\_sip.c:12487 reload\_config: Unable to load config sip.conf

configuration r as under

res\_mysql.conf

[general]  
dbhost = 127.0.0.1  
dbname = asterisk  
dbuser = root  
dbpass = 123  
dbport = 3306  
dbsock = /var/lib/mysql/mysql.sock // (i found mysql sock here)

and set password for mysql

SET PASSWORD FOR  
-\> ‘root’@localhost’ = OLD\_PASSWORD(‘123’); //(and its ok)

set privileges as

grant show databases on _._ to asterisk@localhost identified by 123;

extconfig.conf

sip.conf =\> mysql,asterisk,sip\_budd

so…

---

<div class="post-metadata">

**Author:** ![pbrunnen](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pbrunnen](https://community.asterisk.org/u/pbrunnen)\
**Post date:** [November 17, 2006, 2:24pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/9 "2006-11-17T14:24:51Z")

</div>

Per this line:

> res\_config\_mysql.c:417 config\_mysql: MySQL RealTime: Query Failed because: Unknown column ‘category’ in ‘field list’

Your Query Failed. This means that your table is not setup properly.  
You can see this with "Unknown column ‘category’ in ‘field list’ ". That is a basic SQL error pointing to the fact that ‘catagory’ is not a column in your table.

Not to be mean or anything, but it really does not seem like you have done any homework on this. A simple search in google for ‘asterisk realtime’ will lead you to several very good resources on this.

Please take a look at (and read it completely as some comments may suggest doing things a bit differently than those listed at the top of the document):

[voip-info.org/wiki-Asterisk+RealTime](http://www.voip-info.org/wiki-Asterisk+RealTime)

Good Luck. -Cheers, Peter.

---

<div class="post-metadata">

**Author:** ![808blogger](https://avatars.discourse-cdn.com/v4/letter/8/b5e925/32.png) [@808blogger](https://community.asterisk.org/u/808blogger)\
**Post date:** [November 17, 2006, 8:48pm UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/10 "2006-11-17T20:48:35Z")

</div>

make sure to read the realtime wiki…

did you even setup your database? did you setup the tables?

the asterisk realtime wiki has the DB structure that you need…

[quote=“dosti”]thanks for reply…i follow ur suggestions and now its seems a bit better…and now i got this reply.

\*CLI\>  
Nov 17 11:13:11  
DEBUG[3113]: res\_config\_mysql.c:674 mysql\_reconnect: MySQL RealTime: Everything is fine.  
Nov 17 11:13:11 WARNING[3113]: res\_config\_mysql.c:415 config\_mysql: MySQL RealTime: Failed to query database. Check debug for more info.  
Nov 17 11:13:11 WARNING[3113]: res\_config\_mysql.c:415 config\_mysql: MySQL RealTime: Failed to query database. Check debug for more info.

Nov 17 11:13:11 DEBUG[3113]:  
res\_config\_mysql.c:416 config\_mysql: MySQL RealTime: Query: SELECT category, var\_name, var\_val, cat\_metric FROM sip\_budd WHERE filename=‘sip.conf’ and commented=0 ORDER BY filename, cat\_metric desc, var\_metric asc, category, var\_name, var\_val, id

Nov 17 11:13:11 DEBUG[3113]:  
res\_config\_mysql.c:417 config\_mysql: MySQL RealTime: Query Failed because: Unknown column ‘category’ in 'field list’  
Nov 17 11:13:11 NOTICE[3113]: chan\_sip.c:12487 reload\_config: Unable to load config sip.conf  
Nov 17 11:13:11 NOTICE[3113]: chan\_sip.c:12487 reload\_config: Unable to load config sip.conf

configuration r as under

res\_mysql.conf

[general]  
dbhost = 127.0.0.1  
dbname = asterisk  
dbuser = root  
dbpass = 123  
dbport = 3306  
dbsock = /var/lib/mysql/mysql.sock // (i found mysql sock here)

and set password for mysql

SET PASSWORD FOR  
-\> ‘root’@localhost’ = OLD\_PASSWORD(‘123’); //(and its ok)

set privileges as

grant show databases on _._ to asterisk@localhost identified by 123;

extconfig.conf

sip.conf =\> mysql,asterisk,sip\_budd

so…[/quote]

---

<div class="post-metadata">

**Author:** ![ali\_raja](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@ali\_raja](https://community.asterisk.org/u/ali_raja)\
**Post date:** [November 24, 2006, 8:06am UTC](https://community.asterisk.org/t/asterisk-real-time-error/10467/11 "2006-11-24T08:06:14Z")

</div>

hi

thanks alot i got it working query is secessful
