4 messages in com.mysql.lists.plusplusRe: setting max_allowed_packet value
FromSent OnAttachments
Rumpel Stiltzkin29 Mar 2004 20:45 
Sinisa Milivojevic30 Mar 2004 02:40 
Rumpel Stiltzkin30 Mar 2004 10:16 
Sinisa Milivojevic31 Mar 2004 02:41 
Subject:Re: setting max_allowed_packet value
From:Sinisa Milivojevic (sin@mysql.com)
Date:03/30/2004 02:40:44 AM
List:com.mysql.lists.plusplus

Rumpel Stiltzkin wrote:

Hi, I am enhancing a program (in VC++) to be able to use a MySQL database. Now, the way I start MySQL in case the server is not already running when my program is run is by using:

HINSTANCE result = ShellExecute(NULL, _T("open"), _T("winmysqladmin"), NULL,_T("C:\\mysql\\bin"), SW_SHOWDEFAULT ); ...(i)

Once the server starts, the value of 'max_allowed_packet' is 1MB. Now at run-time, I want to store something really huge (an image) in the database and so I want to set 'max_allowed_packet' to something big, say 16MB. I tried using mysql_options():-

mysql_options(db, MYSQL_READ_DEFAULT_FILE, options_filename)

to read a config file (C:/foobar/myownfoo.ini )which has the line:

set-variable=max_allowed_packet=16MB ... (ii)

But for some reason, I still get the usual 'Got packet bigger than max_allowed_packet' error message when I execute the query. I am calling mysql_options() AFTER mysql_init() and BEFORE mysql_real_connect(). I tried to uncomment (ii) in the usual C:/WINDOWS/my.ini file and everything works fine. BUT, I don't want to do that. I want to be able to read another options file and change the value at runtime for certain queries. Another thing that is also acceptable is, when I run winmysqladmin.exe in (i), I read myownfoo.ini , and set max_allowed_packet to 16MB when the server initially starts. Then I don't need to use mysql_options().

Can someone please throw some light on this? Thanks in advance.

First of all, on NT/W2K/XP it is advisable to start a service.

Regarding the above option, it will read options on the client side only.

To make server read options, file has to be named properly and in the proper directory, as per our manual.

--

Sincerely,

Meet the MySQL at User Conference ! (April 14-16, 2004) http://www.mysql.com/uc2004/