mhmhm, I edited gw/sqlbox_mysql.c from the sqlbox source and modified
the panic line in the end so the code is like here below, and the DB
params are shown ok
/*
* ok, ready to connect to MySQL
*/
db_conf = gw_malloc(sizeof(DBConf));
gw_assert(db_conf != NULL);
db_conf->mysql = gw_malloc(sizeof(MySQLConf));
gw_assert(db_conf->mysql != NULL);
db_conf->mysql->host = mysql_host;
db_conf->mysql->username = mysql_user;
db_conf->mysql->password = mysql_pass;
db_conf->mysql->database = mysql_db;
if (have_port) {
db_conf->mysql->port = mysql_port;
}
pool = dbpool_create(DBPOOL_MYSQL, db_conf, pool_size);
gw_assert(pool != NULL);
/*
* XXX should a failing connect throw panic?!
*/
if (dbpool_conn_count(pool) == 0)
panic(0,"SQLBOX: MySQL: database pool has no connections! host
'%s' user '%s' pass '%s' db '%s'", octstr_get_cstr(mysql_host),
octstr_get_cstr(mysql_user), octstr_get_cstr(mysql_pass),
octstr_get_cstr(mysql_db));
//panic(0,"SQLBOX: MySQL: database pool has no connections!");
On Nov 14, 2007 12:41 PM, seik <[EMAIL PROTECTED]> wrote:
> Err,
> i think its the same issue as the one with the bearerbox host :/
>
>
>
> -----Original Message-----
> From: Juan Nin [EMAIL PROTECTED]
> Sent: 14 ??????? 2007 ?.
> To: seik
> Subject:sqlbox does not connect to remote MySQL
>
>
> > Hi!
>
> > I'm trying sqlbox, and I can't get it to connect to a remote MySQL server...
> > It's really strange...
>
> > I got "dlr-storage = mysql" with the same settings and it connects
> > fine, but sqlbox does not...
> > if I run a local MySQ, using localhost it works fine, but not with a
> > remote one...
>
> > Here's the error I get:
>
> > 2007-11-14 08:58:06 [18604] [0] INFO: Added logfile
> > `/var/log/kannel/sqlbox.log' with level `0'.
> > 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: can not connect to database!
> > 2007-11-14 08:58:06 [18604] [0] ERROR: MYSQL: Can't connect to MySQL
> > server on '10.10.10.2' (111)
> > 2007-11-14 08:58:06 [18604] [0] PANIC: SQLBOX: MySQL: database pool
> > has no connections!
> > 2007-11-14 08:58:06 [18604] [0] PANIC:
> > /usr/local/kannel/sbin/sqlbox(gw_panic+0x15b) [0x4248ab]
> > 2007-11-14 08:58:06 [18604] [0] PANIC:
> > /usr/local/kannel/sbin/sqlbox(sqlbox_init_mysql+0x34f) [0x40afdf]
> > 2007-11-14 08:58:06 [18604] [0] PANIC:
> > /usr/local/kannel/sbin/sqlbox(sqlbox_init_sql+0xb) [0x40bfbb]
> > 2007-11-14 08:58:06 [18604] [0] PANIC:
> > /usr/local/kannel/sbin/sqlbox(main+0x31f) [0x409dcf]
> > 2007-11-14 08:58:06 [18604] [0] PANIC:
> > /lib64/libc.so.6(__libc_start_main+0xf4) [0x3460c1d8a4]
> > 2007-11-14 08:58:06 [18604] [0] PANIC: /usr/local/kannel/sbin/sqlbox
> > [0x4099a9]
>
> > Here's the conf:
>
> > group = sqlbox
> > id = sqlbox-db
> > smsbox-id = smsbox
> > bearerbox-host = localhost
> > bearerbox-port = 13001
> > smsbox-port = 13005
> > smsbox-port-ssl = false
> > sql-log-table = sent_sms
> > sql-insert-table = send_sms
> > log-file = "/var/log/kannel/sqlbox.log"
> > log-level = 0
>
> > group = mysql-connection
> > id = sqlbox-db
> > host = 10.10.10.2
> > username = myUser
> > password = myPass
> > database = kannel
> > max-connections = 1
>
> > And this is the conf for DLR which works fine:
>
> > group = mysql-connection
> > id = mydlr
> > host = 10.10.10.2
> > username = myUser
> > password = myPass
> > database = kannel
> > max-connections = 1
>
> > I even ran a tcpdump on the DB server, and I don't see packets
> > arriving for the sqlbox connection...
> > any ideas???
>
> > Thanks in advance,
>
> > Juan
>
> > PS: obviously connecting from the kannel host to the remote one via
> > console works (same info as for DLRs which connects ok)
>
>
>