10 messages in com.mysql.lists.plusplusRe: Strange behavior of connect() whe...
FromSent OnAttachments
António Santos27 Feb 2008 07:58 
Warren Young27 Feb 2008 18:12 
António Santos28 Feb 2008 06:45 
Warren Young28 Feb 2008 13:05 
Warren Young28 Feb 2008 13:15 
António Santos29 Feb 2008 01:27 
William F. Dowling29 Feb 2008 07:00 
Warren Young29 Feb 2008 12:08 
António Santos06 Mar 2008 06:32 
Warren Young06 Mar 2008 23:43 
Subject:Re: Strange behavior of connect() when specifying a different port
From:António Santos (ansa@fe.up.pt)
Date:02/28/2008 06:45:12 AM
List:com.mysql.lists.plusplus

I've been using Connection::connect() to connect to my MySQL 4.1 server but I wanted it to use a different port than the default 3306. However, even if I change the port parameter, mysql++ continues to use the default 3306!!

MySQL++ 2.3.2 passes that value directly to the C API, so any problem is likely in the way you call the function, not in MySQL++. Please post your connect() call code.

Here it is:

mysqlpp::Connection conn = mysql::Connection(false); if (!conn.connect("wgwps", "127.0.0.1", "ans", "bns", 4040)) { perror("Connection::connect"); return 1; }

I set the port to 4040, but it continues to connect to 3306. I tried with MySQL C API directly and this issue didn't happen.

Thanks!