<h3>Description</h3>
<p>If in kamailio.cfg I write IPv6 address for Database URL like this:</p>
<pre><code>#!ifndef DBURL
#!define DBURL "mysql://kamailio:kamailiorw@[2001:5c8:4e00:11:a213:ba2d:579a:3e3d]/kamailio"
#!endif
</code></pre>
<p>Then kamailio can't connect to database.</p>
<h4>Reproduction</h4>
<p>Just try to use database server with IPv6-address in kamailio.cfg</p>
<h4>Log Messages</h4>
<pre><code>Sep  8 14:35:40 c7-01 /sbin/kamailio[10680]: ERROR: db_mysql [km_my_con.c:139]: db_mysql_new_connection(): driver error: Unknown MySQL server host '[2001' (2)
Sep  8 14:35:40 c7-01 /sbin/kamailio[10680]: ERROR: <core> [db.c:319]: db_do_init2(): could not add connection to the pool
Sep  8 14:35:40 c7-01 /sbin/kamailio[10680]: ERROR: usrloc [dlist.c:646]: register_udomain(): failed to open database connection
</code></pre>
<h3>Possible Solutions</h3>
<p>Correct parsing of config file.</p>
<h3>Additional Information</h3>
<pre><code>version: kamailio 5.3.0-dev7 (x86_64/linux) 
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<p>CentOS 7</p>
<pre><code>Linux sip.aaa.de 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2060?email_source=notifications&email_token=ABO7UZNSV24IK2NTDVEUG33QIUCQRA5CNFSM4IUTS3BKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKAM34Q">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLM6AU3CLMPGORAQZTQIUCQRANCNFSM4IUTS3BA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZMMYRJ7EM7GZQKZK3TQIUCQRA5CNFSM4IUTS3BKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKAM34Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2060?email_source=notifications\u0026email_token=ABO7UZNSV24IK2NTDVEUG33QIUCQRA5CNFSM4IUTS3BKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKAM34Q",
"url": "https://github.com/kamailio/kamailio/issues/2060?email_source=notifications\u0026email_token=ABO7UZNSV24IK2NTDVEUG33QIUCQRA5CNFSM4IUTS3BKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKAM34Q",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>