Back

[SOLVED] MySQL Server has gone away

  • 0
  • Self Hosted
  • Databases
  • Web
David
14 Sep, 2023, 09:25

I doubt if I am using an external MySQL because all I did was a default Appwrite install on a Compute Engine

TL;DR
MySQL Server has gone down and caused the database to get corrupted. The issue was solved by restoring a previous backup. To prevent this from happening again, it is recommended to regularly backup the database. Upgrading to a new version may have contributed to the problem. It is also suggested to investigate the cause of the server going down to prevent future occurrences. The user confirmed that the server is now working.
D5
14 Sep, 2023, 09:27

Then you're using MariaDB

D5
14 Sep, 2023, 09:27

This is a completely fresh install, true?

David
14 Sep, 2023, 09:29

It has some organisations, projects and databases on it.

David
14 Sep, 2023, 09:29

We've been using it for about 3 months now

D5
14 Sep, 2023, 09:29

You don't have backups?

David
14 Sep, 2023, 09:30

No

D5
14 Sep, 2023, 09:30

Could you please run the command docker compose logs mariadb Send here the result

David
14 Sep, 2023, 09:36
D5
14 Sep, 2023, 10:14

Did you have upgraded recently?

David
14 Sep, 2023, 10:15

Upgraded to 1.4 from 1.3.7 but things didn't work out and I restored

D5
14 Sep, 2023, 10:16

And after restoring you're getting that or is it just after upgrading?

David
14 Sep, 2023, 10:17

This error started occuring yesterday. But I had restored a week ago

D5
14 Sep, 2023, 10:17

I see. Seems like your database got corrupted in some way. Maybe you have restarted or your instance crashed?

David
14 Sep, 2023, 10:19

When I found out that error I decided to run docker compose stop

David
14 Sep, 2023, 10:19

And docker compose up -d

David
14 Sep, 2023, 10:19

Now the instance works but I want to find out the cause of MySQL going down so that I can prevent it for longterm

D5
14 Sep, 2023, 10:21

I think it was caused due to a crash in the main container

D5
14 Sep, 2023, 10:23

It's just a hypothesis, so it's not a confirmation. There could be several reasons. I think this should not happen again, however for in case it happens anyways, doing regular backups is the key, so you could restore if data gets corrupted, I don't think this will happen, but better adopt more measures than not doing anythingπŸ˜…. I was going to send some instructions to recover the database, but seems not needed

D5
14 Sep, 2023, 10:24

From what I understand, it's working now?

David
14 Sep, 2023, 10:27

Yes it's working now.

David
14 Sep, 2023, 10:28

What tips can you suggest to keep regular backups?

D5
14 Sep, 2023, 11:01

There are several ways to do backups. I think if you can automate it, that will be the most ideal thing you could do. I automate it by having a bash script that is being automatically triggered that dumps the entire database and uploads it to a FTP server

D5
14 Sep, 2023, 11:19

[SOLVED] MySQL Server has gone away

David
14 Sep, 2023, 11:32

Thank you

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more