Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16
  1. #1
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003

    [mysql] upload file grosse dimensioni

    Salve gente.. ho un problemino..

    Premetto che ho modificato il php.ini...
    Quando tento di fare un upload di un file di dimensioni superiore ai 2 mega (in un campo longblob del database) mi va in quello che credo sia un timeout e me restituisce questo:

    MySQL server has gone away

    Che è? :master:

  2. #2
    Dovresti aumentare il valore max_allowed_packet del server SQL dentro il file my.ini (credo.....)

  3. #3
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    max_allowed_packet current value: 16777216

    com'è possibile che va in timeout per un file di 4/5 mega?

  4. #4
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    Allora ho modificato tutti i valori in
    my-huge.cnf
    my-large.cnf
    my-medium.cnf
    my-small.cnf

    settandoli così

    [client]
    set-variable max_allowed_packet=32M

    .......

    [mysqld]
    set-variable max_allowed_packet=32M

    ho restartato mysql ma niente. Perchè?

  5. #5
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    think simple think ringo

  6. #6
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    Ho già letto.. ma nn capisco in che modo dovrei modificare i parametri... se mi connetto da shell a mysql e do il comando set-variable ovviamente mi dà errore.
    Se lo do senza connettermi (mysql --set-variable=max_allowd_packet=32M) mi dà il prompt di mysql senza apportare alcuna variazione

  7. #7
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    Ok rileggendo meglio qua FORSE ho capito

    Vi faccio sapere

  8. #8
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003


    :quote: è abbastanza eloquente questa ?

  9. #9
    Utente di HTML.it L'avatar di VaLvOnAuTa
    Registrato dal
    Jun 2002
    Messaggi
    2,003
    E se non dipendesse dalla grandezza del file, ma dal tempo di esecuzione della query?

  10. #10
    Varda anche qui

    http://dev.mysql.com/doc/mysql/en/Packet_too_large.html

    When a MySQL client or the mysqld server receives a packet bigger than max_allowed_packet bytes, it issues a Packet too large error and closes the connection. With some clients, you may also get a Lost connection to MySQL server during query error if the communication packet is too large.

    Both the client and the server have their own max_allowed_packet variable , so if you want to handle big packets, you must increase this variable both in the client and in the server.

    If you are using the mysql client program, its default max_allowed_packet variable is 16MB. That is also the maximum value before MySQL 4.0. To set a larger value from 4.0 on, start mysql like this:

    mysql> mysql --max_allowed_packet=32M

    That sets the packet size to 32MB.

    The server's default max_allowed_packet value is 1MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this:

    mysql> mysqld --max_allowed_packet=16M
    Ciauz!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.