Apr-19-2018, 06:48 AM
Hi,
I am new to python.
I have an ejabberd chat server. I have an external authentication python file to connect to mysql db.
On adding the below code and restarting the chat server, the external authentication script is failing. CAN ANYONE HELP PLEASE...
I am new to python.
I have an ejabberd chat server. I have an external authentication python file to connect to mysql db.
On adding the below code and restarting the chat server, the external authentication script is failing. CAN ANYONE HELP PLEASE...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
######################################################################## #DB Settings #Just put your settings here. ######################################################################## db_name = "test" db_user = "root" db_pass = "" db_host = "localhost" db_table = "cc_customer_profiles" ######################################################################## #Setup ######################################################################## import sys, logging, struct, hashlib from struct import * sys.stderr = open ( '/opt/ejabberd/extauth_err.log' , 'a' ) logging.basicConfig(level = logging.INFO, format = '%(asctime)s %(levelname)s %(message)s' , filename = '/opt/ejabberd/extauth.log' , filemode = 'a' ) logging.info( "connect to db" ) try : database = MySQLdb.connect(db_host, db_user, db_pass, db_name) logging.info( "success db" ) except : logging.info( "Unable to initialize database, check settings!" ) dbcur = database.cursor() |
Error:[critical] <0.612.0>@extauth:loop:137 extauth script has exitted abruptly with reason 'normal'