MySQL Forums
Forum List  »  Newbie

Script ends saying : MySQL server has gone away
Posted by: Patrick Plante
Date: July 16, 2018 09:55AM

Hi everyone, I made a script that works, but the 'job' I'm asking is taking too much time or ressources, so the script ends up telling this : MySQL server has gone away

I have a folder called 'files' on my FTP in which all files submitted by users are saved. When a user saves a files under his account, a new row is created in the DB with 'filepath' and 'filesize' in the new entry, the upload then proceeds to that 'files' folder, so the user has all his files in the MySQL database that refers to the actual file on the FTP.

I then created a script that would let me delete a user, but before removing the user from the DB, I want to make a copy of all his files in a new directory (files_backup/<user_id>), so it's not cluttering the 'files' folder. I can afterwards copy and delete the 'files_backup' to a more decent backup place elsewhere.

So, everything worked fine up until I arrived at users that had many files, I ended up getting 'MySQL server has gone away' after about 90 seconds.

Is this a memory issue when it copies files? A time thing? How can I make sure to get it proceed to the end succesfully?

Thanks a lot!

Options: ReplyQuote


Subject
Written By
Posted
Script ends saying : MySQL server has gone away
July 16, 2018 09:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.