[SR-Users] driver error: Can't connect to MySQL server with kamailio 5.3.x and mysql-config-groups

Karsten Horsmann khorsmann at gmail.com
Wed Oct 23 18:37:19 CEST 2019


Hi Henning,


Another problem is that every new special char for separating is lost for
passwords. The / for example and [] and so one.

Is the ipv6 for DBURL hosts only in ip notation or also dns names? That's
not clear for me.

If it's ipv6 ip only it can checked for the separators of an ipv6 ip.


Henning Westerholt <hw at skalatan.de> schrieb am Mi., 23. Okt. 2019, 18:29:

> Hello,
>
>
>
> just an idea – maybe the easiest way would be to introduce another
> character for the groups, e.g. ‘{ }’ or similar. The overlapping between
> IPv6 and groups was not intended, the group support is probably older as
> IPv6 in Kamailio. 😉
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt - https://skalatan.de/blog/
>
> Kamailio services - https://skalatan.de/services
>
>
>
> *From:* sr-users <sr-users-bounces at lists.kamailio.org> *On Behalf Of *Karsten
> Horsmann
> *Sent:* Wednesday, October 23, 2019 6:17 PM
> *To:* Daniel-Constantin Mierla <miconda at gmail.com>
> *Cc:* Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
> *Subject:* Re: [SR-Users] driver error: Can't connect to MySQL server
> with kamailio 5.3.x and mysql-config-groups
>
>
>
> Hi Daniel,
>
>
>
> you mean this commit (see below). Maybe  Alexey Vasilyev can told us
> something to that change?
>
>
>
> How can i use mysql-groups in the [] notation? Like:
>
> #!define DBURL "mysql://[kamailio]/kamailio"
>
> https://kamailio.org/docs/modules/5.3.x/modules/db_mysql.html#idm140
>
>
>
> AFAIK this change splits [ and ] to ipv6 Host and sets ST_HOST6 and
>
>
>
> commit a7588f382605991bef4499de8c89b10a9468c8cf
> Author: Alexey Vasilyev <alexei.vasilyev at gmail.com>
> Date:   Wed Sep 4 13:47:23 2019 +0300
>
>     db_mysql: database URL supports IPv6 address as hostname
>
>     - changed parsing of db_url to accept IPv6 address for hostname
>
>
>
> Any help would be appreciated.
>
>
>
> Cheers Karsten
>
>
>
>
>
> Am Mi., 23. Okt. 2019 um 08:10 Uhr schrieb Daniel-Constantin Mierla <
> miconda at gmail.com>:
>
> Hello,
>
> it could be that a patch to support ipv6 in the db url is conflicting with
> the syntax for the group name, because both seem to use [ ] . Iirc, such a
> commit was not long time ago. I will have to look at the code for mysql
> conf group to see what exactly it expects, not sure I got time for it
> today, though, maybe others can check quicker.
>
> Cheers,
> Daniel
>
> On 22.10.19 16:38, Karsten Horsmann wrote:
>
> Hi Daniel,
>
>
>
> i create an Logfile with debug=3 on startup here:
> https://gist.github.com/khorsmann/91642daaa3715c59624cd5272bc3398a#file-logfile-txt-L4345
>
>
>
>
>  0(29174) DEBUG: db_mysql [km_my_con.c:108]: db_mysql_new_connection():
> opening connection: mysql://xxxx:xxxx@kamailio/kamailio
>
> I dont know where kamailio though that there is an "hostname" kamailio
> that holds the mysqldb/kamailio.
>
>
>
> I want to use groups in the future - cos i auto-generate mysql-passwords
> with / for example and that is possible in groups, but i dunno how in
> normal defines.
>
>
>
> Cheers
>
> Karsten
>
>
>
> Am Di., 22. Okt. 2019 um 15:40 Uhr schrieb Daniel-Constantin Mierla <
> miconda at gmail.com>:
>
> Hello,
>
> if you set debug=3, do you see any other log message that can give hints
> about the error?
>
> I do not recall any change in using mysql conf groups, but there were some
> changes in supporting usernames with domains and few other updates that
> could have affected indirectly this part.
>
> Cheers,
> Daniel
>
> On 22.10.19 15:20, Karsten Horsmann wrote:
>
> Hi List,
>
>
>
> me again - i also updated the test-system to latest CentOS 7.7.1908 to be
> sure that the rpm building source and my target system are on the same
> versions.
>
>
>
>  lsb_release -a
> LSB Version:    :core-4.1-amd64:core-4.1-noarch
> Distributor ID: CentOS
> Description:    CentOS Linux release 7.7.1908 (Core)
> Release:        7.7.1908
> Codename:       Core
>
>
>
> Am Di., 22. Okt. 2019 um 14:58 Uhr schrieb Karsten Horsmann <
> khorsmann at gmail.com>:
>
> Hi List,
>
>
>
> i updated one of my testing kamailios from 5.2.x to latest 5.3.x.
>
> After restarting the process, i got an mysql error that the server
> "kamailio" is not found.
>
>
>
> I use the config-feature of my.cnf config-group names within the
> kamailio.cfg
> I can start my kamailio 5.3.x installation with "normal
> username:password at host" definitions for DBURL.
>
>
>
> Did anyone have the same issue?
>
>  0(19625) ERROR: db_mysql [km_my_con.c:139]: db_mysql_new_connection():
> driver error: Can't connect to MySQL server on 'kamailio' (4)
>  0(19625) ERROR: <core> [db.c:319]: db_do_init2(): could not add
> connection to the pool
>  0(19625) ERROR: dialplan [dp_db.c:179]: dp_connect_db(): unable to
> connect to the database
>  0(19625) ERROR: dialplan [dialplan.c:191]: mod_init(): could not
> initialize data
>  0(19625) ERROR: <core> [core/sr_module.c:850]: init_mod(): Error while
> initializing module dialplan (/usr/lib64/kamailio/modules/dialplan.so)
> ERROR: error while initializing modules
>
>
> from my kamailio.cfg i defined the DBURL like this:
>
>
> # Use /etc/my.cnf.d/kamailio.cnf to store credentials
> # within a mysql-db-group
> #!define DBURL "mysql://[kamailio]/kamailio"
>
> and special modules can use it like this (or via DBURL)
> modparam("sqlops", "sqlcon", "cb=>mysql://[kamailio]/kamailio")
>
> cat /etc/my.cnf.d/kamailio.cnf
>
>
> # MySQL configuration group for kamailio
> [kamailio]
> user=kamailio
> password="kamailiorw"
> host=172.20.100.22
>
>
> rpm -qa | grep kam
> kamailio-dialplan-5.3.0-13.1.x86_64
> kamailio-websocket-5.3.0-13.1.x86_64
> kamailio-jansson-5.3.0-13.1.x86_64
> kamailio-mysql-5.3.0-13.1.x86_64
> kamailio-tls-5.3.0-13.1.x86_64
> kamailio-ims-5.3.0-13.1.x86_64
> kamailio-statsd-5.3.0-13.1.x86_64
> kamailio-5.3.0-13.1.x86_64
> kamailio-redis-5.3.0-13.1.x86_64
>
>
>
>  cat /etc/redhat-release
> CentOS Linux release 7.6.1810 (Core)
>
>
>
> --
>
> Cheers
> *Karsten Horsmann*
>
>
>
>
> --
>
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
>
>
> _______________________________________________
>
> Kamailio (SER) - Users Mailing List
>
> sr-users at lists.kamailio.org
>
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
>
> Daniel-Constantin Mierla -- www.asipto.com
>
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>
>
>
>
> --
>
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
> --
>
> Daniel-Constantin Mierla -- www.asipto.com
>
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>
>
>
>
> --
>
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191023/2cc1dee6/attachment.html>


More information about the sr-users mailing list