OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.28k stars 583 forks source link

[BUG]db_mysql connect failed #3516

Open gao114882 opened 1 day ago

gao114882 commented 1 day ago

OpenSIPS version you are running

./opensips -V        
version: opensips 3.3.10 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on 06:05:46 Nov 15 2024 with gcc 4.8.5

Describe the bug

mysql host:172.16.4.111 port: 3306 userName: martbase@gtja_smartcc#obcluster
password: Smartbase7890

Can we support this format?

db_url: mysql://martbase@gtja_smartcc#obcluster:Smartbase7890@172.16.4.111:3306/opensips

error:

core:str2s: unexpected char S in Smartbase7890@172.16.4.111:3306
Nov 15 14:47:46 [108] DBG:core:db_do_init: connection 0x7efd3cf84508 not found in pool
Nov 15 14:47:46 [108] DBG:db_mysql:db_mysql_connect: opening connection: mysql://xxxx:xxxx@gtja_smartcc#obcluster/sbc
Nov 15 14:47:46 [108] ERROR:db_mysql:db_mysql_connect: driver error(2005): Unknown MySQL server host 'gtja_smartcc#obcluster' (2)
Nov 15 14:47:46 [108] ERROR:db_mysql:db_mysql_new_connection: initial connect failed
Nov 15 14:47:46 [108] ERROR:core:db_do_init: could not add connection to the pool
Nov 15 14:47:46 [108] ERROR:usrloc:destroy: failed to connect to database

To Reproduce

Expected behavior

Relevant System Logs

OS/environment information

Additional context

gao114882 commented 1 day ago

Kamailio 5.7 can parse this URL correctly,