Re: Bug #3742: PHP upload + MySQL insert fails for anything more than 1 meg
| From: | Troels Arvin | Date: | Tue, 07 Mar 2000 23:40:22 +0000 |
| Subject: | Re: Bug #3742: PHP upload + MySQL insert fails for anything more than 1 meg | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16516@lists.php.net to get a copy of this message | ||
ghost@homeloaf.dynip.com wrote:
> it seems there is some arbitrary limit of 1 meg set
> that prohibits me from uploading the file.
This is not a bug (please change status to "close"). Read
http://www.mysql.com/Manual_chapter/manual_Performance.html#Server_parameters
You need to add the following switch in the script that starts MySQL:
-O max_allowed_packet=5M
(Although 5 megs seems _rather_ high. Consider setting a lower limit, as
this setting might impact MySQL's performance.)
A resulting segment of a script which starts MySQL could look like this:
pid_file=/var/lib/mysql/mysqld.pid
bindir=/usr/bin
datadir=/var/lib/mysql
mysql_daemon_user=mysql
echo "Cleaning/repairing SQL tables"
if [ ! -f $pid_file ]; then
isamchk -Sso /var/lib/mysql/*/*.ISM
fi
echo "Starting MySQL"
if test -x $bindir/safe_mysqld
then
$bindir/safe_mysqld -O max_allowed_packet=5M \
--user=$mysql_daemon_user --skip-networking \
--pid-file=$pid_file --datadir=$datadir &
else
echo "Can't execute $bindir/safe_mysqld"
fi
To verify that MySQL is running with the new max-allowed-packet tuning,
execute
mysqladmin -u root -p variables
and watch the line called "max_allowed_packet"
--
Greetings from Troels Arvin,
Enterprise Interactive - http://www.e-i.dk/
Direct phone +45 - 3525 3230