I need to increase the max_allowed_packet in order to upload large data files into a BLOB field. After googling this, I've found several instructions all involving changing the "my.cnf" file. But, I don't have this file! How do I change this value? I can't find any config type files.
I have MySQL 4.0.23 on Windows Server 2003.
Thanks, Swede
How do I change max_allowed_packet in MySQL?
Moderator: General Moderators
It's a MEDIUMBLOB, and the size of the data being put in is up to 8MB. In this case, php is not being used to communicate with MySQL. So, I'm getting a "packet too large" error.
The strange thing is that I have no configuration files. I can't find a "my.cnf" file. I found on mysql.com a line to enter into the mysql client program that will increase it.
Also, here's what mysql.com says about adding it to the config file:
Thank you, Swede
The strange thing is that I have no configuration files. I can't find a "my.cnf" file. I found on mysql.com a line to enter into the mysql client program that will increase it.
However, I am guessing that this only temporarily changes it and if it gets re-booted, it will go back to the default. I just have to test that at a non-busy time.mysql> mysqld --max_allowed_packet=16M
Before MySQL 4.0, use this syntax instead:
mysql> mysqld --set-variable=max_allowed_packet=16M
Also, here's what mysql.com says about adding it to the config file:
But, what option file? What is this option file called, and where is it located. I went through each mysql/ directory, and did not find any config file.You can also use an option file to set max_allowed_packet. For example, to set the size for the server to 16MB, add the following lines in an option file:
[mysqld]
max_allowed_packet=16M
Before MySQL 4.0, use this syntax instead:
[mysqld]
set-variable = max_allowed_packet=16M
Thank you, Swede