[OpenSIPS-Users] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock

M.Abdulaziz malduwais1 at ksu.edu.sa
Fri Dec 2 21:43:14 CET 2011


Hello All,

I was trying to configure opensips as a registerar but when uac clients
sends the registration requests I got no reaction from opensips & I got
these error messages:


Dec  2 22:29:16 [13681] DBG:db_mysql:db_mysql_connect: opening connection:
mysql://xxxx:xxxx@localhost/opensips
Dec  2 22:29:16 [13681] ERROR:db_mysql:db_mysql_connect: driver error(2002):
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
Dec  2 22:29:16 [13681] ERROR:db_mysql:db_mysql_new_connection: initial
connect failed
Dec  2 22:29:16 [13681] ERROR:core:db_do_init: could not add connection to
the pool
Dec  2 22:29:16 [13681] ERROR:usrloc:register_udomain: failed to open
database connection
Dec  2 22:29:16 [13681] ERROR:registrar:domain_fixup: failed to register
domain
Dec  2 22:29:16 [13681] ERROR:core:fix_actions: fixing failed (code=-1) at
cfg line 67
Dec  2 22:29:16 [13681] ERROR:core:main: failed to fix configuration with
err code -1
Dec  2 22:29:16 [13681] DBG:core:shm_mem_destroy: 
Dec  2 22:29:16 [13681] DBG:core:shm_mem_destroy: destroying the shared
memory lock
Dec  2 22:29:16 [13679] DBG:core:wait_status_code: read code 111 ? rc = 0,
errno=Success
Dec  2 22:29:16 [13679] INFO:core:daemonize: pre-daemon process exiting with
-1


********************************************* Here is my opensips.cfg file*


# ----------- global configuration parameters ------------------------

debug=6           # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=yes   # (cmd line: -E)
children=8



listen=udp:192.168.1.69:5060
auto_aliases=no

log_name="OPENSIPS-71"
log_facility=LOG_LOCAL0

# ------------------ module loading ----------------------------------

#set module path
mpath="/usr/local/lib64/opensips/modules/"

# Uncomment this if you want to use SQL database

loadmodule "db_mysql.so"
loadmodule "sl.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "signaling.so"
#loadmodule "mi_fifo"

# ----------------- setting module-specific parameters ---------------


# -- usrloc params --


modparam("usrloc", "db_mode",   2)
modparam("usrloc",
"db_url","mysql://opensips:opensipsrw@localhost/opensips")


# -------------------------  request routing logic -------------------

# main routing logic

route{
	
	if(is_method("REGISTER"))
	{
		#set_time_stamp("before new ul save");
		save("location");
		#diff_time_stamp(1,"after ul save");
		exit;
	}

	#set_time_stamp("before new ul lookup");
	if(lookup("location"))
	{
		#diff_time_stamp(1,"after ul lookup");
		sl_send_reply("200", "ok");
	} else {
		#diff_time_stamp(1,"after ul lookup");
		sl_send_reply("404", "not found");
	}

}



*could someone plz tell me where is mistake?*

Thank you,




--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Can-t-connect-to-local-MySQL-server-through-socket-var-lib-mysql-mysql-sock-tp7056051p7056051.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list