mysql - kern.maxfiles limit exceeded by uid 500 please see tuning(7)



Hi, I have a freebsd 4.10 server (x86) and I run a
shell script as a cron job every 15 minutes. This
scripts enter some data in the mysql database.

The server works fine for a few days, but after
5 days it crashes. I only get this error and cannot
do anything else (except rebooting)
kern.maxfiles limit exceeded by uid 500 please see tuning(7)

uid 500 is mysql, so I would like to know why
mysql is causing this error? why does it need
to open that much files? my current kern.maxfiles
is 1064, shouldn't this be enough?

What should I do this fix that?

add sysctl kern.maxfiles=4256 to /etc/rc.local?
or should I recompile the kernel with a new maxfiles
value?

Is there a way to configure mysql to open
less files?

Can my shell script be the culprit? It does something like
this:

if [ "`echo | ${mysqlbin} 2> /dev/stdout`" ]
then
echo "CREATE DATABASE ${mysqlname};" | ${mysqlpath}
--user=${mysqluser} --password=${mysqlpass}
echo "CREATE TABLE Average (Time DATETIME, AverageBar TINYTEXT,
Average FLOAT);" | ${mysqlbin}
echo "CREATE TABLE DBInfo (No TINYINT UNSIGNED, Server TINYTEXT);" |
${mysqlbin}
fi

echo "INSERT INTO Average (Time, AverageBar, Average) VALUES
('${sqltime}', LOAD_FILE('${tmpfile}.win'), '${avgtotal}');" |
${mysqlbin}

Thanks

.



Relevant Pages