Ciao a tutti, io vorrei chiedervi come mai, essendo in locale, quando faccio l'upload di un file nella mia tabella_files mi arrivi sto errore:
Query non valida: Lost connection to MySQL server during query, 2013

La tabella é creata in questo modo
CREATE TABLE `tabella_files` (
`id` int(11) NOT NULL auto_increment,
`nome_file` varchar(255) collate latin1_general_ci NOT NULL,
`tipo_file` varchar(128) collate latin1_general_ci NOT NULL,
`dati_file` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;



e la pagina in PHP la seguente:
......
$db_connection = mysql_pconnect($db_host,$db_username,$db_password) ;
$db = mysql_select_db($db_database,$db_connection);
if(isset($_POST['invia']))
{
if(!isset($_FILES['file_inviato']) OR $_FILES['file_inviato']['error'] != UPLOAD_ERR_OK)
{
echo "Errore nell'invio del file. Riprova
\n";
exit();
}

$nome_file_temporaneo = $_FILES['file_inviato']['tmp_name'];
$nome_file_vero = $_FILES['file_inviato']['name'];
$tipo_file = $_FILES['file_inviato']['type'];

$dati_file = file_get_contents($nome_file_temporaneo);

$dati_file = addslashes($dati_file);

$query = "INSERT INTO tabella_files SET nome_file = '$nome_file_vero', tipo_file = '$tipo_file', dati_file = '$dati_file' ";
echo "<h2>INSERIMENTO IMMAGINE</h2>
Memorizzazione del file ".$nome_file_vero." nel database eseguita correttamente.";
mysql_query($query) OR die('Query non valida: ' . mysql_error() . mysql_errno() );

}
else
{
echo "
<h2>INSERIMENTO IMMAGINE</h2>
<form enctype=multipart/form-data method=post action=insert.php>
<table>
<tr><td>Inserimento immagine:
</td><td><input type=file name=file_inviato>
</td></tr>

<tr><td colspan=2>
<input type=\"submit\" value=\"OK\" name=\"invia\">
</td></tr></table>
</form> ";
....


grazie a tutti per l'attenzione