Mysql service keeps stopping

Yes, that would be one way. Another is to check how much memory MySQL is allowed to use.

The first thing you could check is to see whether you have swap space allocated. The quickest way is to run the free command. On my home computer it shows 16 GB of RAM, 10 GB of swap:

 free
               total        used        free      shared  buff/cache   available
Mem:        16186984     4342812     6643316      590836     5200856    10905008
Swap:       10485752      456192    10029560

The easiest way to check is via diagnosis on the Yunohost admin page:
image

If you have no swap space, the easiest is to create a swap file. You can do it like this for a swap file of half a GB:

fallocate -l 512M /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile

It will give you an idea how much RAM you would need extra to cover your needs. Keep in mind that swap on disk is much slower than RAM.

Add it to /etc/fstab to have it mounted automatically on boot.