[asterisk-bugs] [JIRA] (ASTERISK-25813) res_config_mysql dbsock parameter

Mc GRATH Ricardo (JIRA) noreply at issues.asterisk.org
Fri Feb 26 11:56:56 CST 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=229732#comment-229732 ] 

Mc GRATH Ricardo commented on ASTERISK-25813:
---------------------------------------------

Hi, thanks.
At first I'm just testing used dialplan to connect to mysql database engine running on the same asterisk system by using simple database.
Therefore I found when it use dialplan application MYSQL(connect etc. ..) it displayed;
 app_mysql.c:381 aMYSQL_connect: mysql_real_connect(mysql,localhost,,dbpass,null,...) failed(2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

So I understood problems becomes from socket configuration, Asterisk couldn't find mysql.sock on '/var/lib/mysql/ path when mysql engine have installed on /var/run/mysql/ path.
Therefore I assumed dialplan MYSQL application configuration is management by res_config_mysql.conf as no find other file where could be assigned configuration path.
So my question how to correct Asterisk invoke of mysql.sock from '/var/lib/mysql/' to /var/run/mysql/  path? 
 

> res_config_mysql dbsock parameter 
> ----------------------------------
>
>                 Key: ASTERISK-25813
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25813
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Addons/app_mysql
>    Affects Versions: 13.1.0
>            Reporter: Mc GRATH Ricardo
>            Assignee: Mc GRATH Ricardo
>
> I'm struggle with  mysql application, specifically dbsock parameter, it WARNING message connection; Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'.
> weird issue Asterisk  invokes a  socket path connection no relationship to any logic configuration, strange whatever make parameters changes such as; dbname, dbuser, dbpass, on res_config_mysql.conf it seems it works, even if detect no database  found, Asterisk will use the default values.
> But not happens with dbsock parameter, whatever set onto res_config_mysql.conf no meaning Asterisk it doesn't assume any condition and always use the path; '/var/lib/mysql/mysql.sock'.
> The most strange point I couldn't  found any configuration file to change these default value.
> Asterisk 13.1.0 built by root @ Asterisk-SoyoM on a i686 running Linux on 2015-01-16 20:52:42 UTC
> res_config_mysql.conf
> {noformat}
> [general]
> dbhost = localhost
> dbname = asterisk
> dbuser = myuser
> dbpass = mypass
> dbport = 3306
> dbsock = =/var/run/mysqld/mysqld.sock
> dbcharset = latin1
> requirements=warn ; or createclose or createchar
> {noformat}
> extensions.conf
> {noformat}
> [bases]
> exten => s,1,MYSQL(Connect connid localhost asterisk mypass credit utf8)
> exten => s,2,MYSQL(Query resultid ${connid} SELECT username,credit FROM credit WHERE callerid=${CALLERIDNUM})
> exten => s,3,MYSQL(Fetch fetchid ${resultid} datavar1 datavar2)
> exten => s,4,GotoIf(${fetchid}?5:7)
> exten => s,5,Festival("User ${datavar1} currently has credit balance of ${datavar2} dollars.")
> exten => s,6,Goto(s,3)
> exten => s,7,MYSQL(Clear ${resultid})
> exten => s,8,MYSQL(Disconnect ${connid})
> {noformat}
> etc/my.conf
> {noformat}
> [mysqld]
> datadir=/var/lib/mysql
> bind-address =localhost
> socket=/var/run/mysql/mysql.sock
> skip-networking
> user=mysql
> # Disabling symbolic-links is recommended to prevent assorted security risks
> symbolic-links=0
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
> [client]
> host=localhost
> socket=/var/run/mysql/mysql.sock
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list