Since update to 12.0, mysql is dead

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.0.17
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: no

Describe your issue

Hello there,

here is my config:

  • YNH running at home on a RPi 3B+
  • Versions:
    yunohost:
    repo: stable
    version: 12.0.17
    yunohost-admin:
    repo: stable
    version: 12.0.7.1
    yunohost-portal:
    repo: stable
    version: 12.0.10
    moulinette:
    repo: stable
    version: 12.0.4
    ssowat:
    repo: stable
    version: 12.0.3

My problem:
Since the update to 12.0 mysql is dead.
I saw that every day reciving the diagnostic message.

Typing:

sudo systemctl status mysql.service

Gives:

sudo systemctl status mysql.service
Warning: The unit file, source configuration file or drop-ins of mysql.service changed on disk. Run 'systemctl daemon-reload' to reload units.
○ mysql.service
     Loaded: error (Reason: Unit mysql.service failed to load properly, please adjust/correct and reload service manager: File exists)
     Active: inactive (dead)

In the web admin, I get the following messages:

**Erreur**: `"500" `

**Action**: `"PUT" /yunohost/api/services/mysql/start`

**Message d'erreur :**

Could not start the service 'mysql'

Recent service logs:-- No entries --

**Pendant le traitement de l'action, le serveur a dit :**

Could not execute the command 'systemctl start mysql'

Typing:

sudo yunohost tools regen-conf mysql.service --dry-run --with-diff

Gives:
Error: Could not regenerate the configuration for category(s):

An idea? :wink:

Share relevant logs or error messages

(see above)

Hello @marco
Did you try sudo systemctl daemon-reload ?
What do the logs say in Tools > services > mysql ?

Hi otm33,
thanks for your feedback.

I tried “sudo systemctl daemon-reload” without success: no feedback but mysql was still dead.
And no trace at all in Tools > services > mysql

And no log when you try to restart mysql from webadmin ?
Have you tried sudo journalctl -u mysql.service --no-pager -n 50 ?

You’re right, that’s so strange to have no log.

Just tried: sudo journalctl -u mysql.service --no-pager -n 50

– No entries –

How can I check if mysql is installed?

You can check with

 which mysql

but it’s installed.
Do you have enough space left ? df -h

and what does mysql --version return ?
In Tools > Services, would there be a service called mariaDB ?

which mysql

returns nothing!

mysql --version

returns

-bash: mysql: command not found

And in Tools > Services, I don’t see any MariaDB

I guess mysql was removed because it was no longer required by any app but the service file is still present. That’s sounds strange.
Are all your apps working fine?
Any warning during upgrade to 12 ?

I just have 1 app installed and working good: AirSonic

I had problems during the upgrade to 12 (because of very light free space on RPI) and tried manually to upgrade and then I found a solution and ran the YNH procedure.
I would like to run NextCloud, how can I install mysql (or mariaDB)?

Tomorrow, I will try this tuto: How to Install MariaDB on Debian 12 - Devtutorial

You don’t need to manually install mariaDB, installing nextcloud app will do it.

To free up space, you can use this yunohost tool. Don’t know if it runs apt autoremove but it may remove unused conf files.
Check if this file is present on your system :/lib/systemd/system/mysql.service.
If you decide to run yunohost tools basic-space-cleanup, after running it check if/lib/systemd/system/mysql.service is still present and if mysql is still present in web admin > tools > services

Thank you very much for your help @otm33

You don’t need to manually install mariaDB, installing nextcloud app will do it.

Ok, I understand.

I ran yunohost tools basic-space-cleanup
Running ls /lib/systemd/system/mysql.service gives ls: cannot access '/lib/systemd/system/mysql.service': No such file or directory

Is it an issue?

What ‘small’ app can I install (instead of NextCloud) easilly to verify the correct installation and run of mariaDB?

:+1: Is msql service shown in webadmin >tools >services ?

Try this: phpmyadmin
(a useful tool)

  • In the Services list, there is no mariaDB and mysql is still dead :frowning:
  • I installed Adminer (similar to phpmyadmin), install seems correct, but in the Services list mysqll is still dead,
  • I try to connect to Adminer: I have an error “No such file or directory”, can not connect. But for sure I don’t have any database to connect to…
  • I tried again: ls /lib/systemd/system/mysql.service it gives again ls: cannot access '/lib/systemd/system/mysql.service': No such file or directory
  • mysql --version → returns “bash: mysql: command not found”

afaik adminer app doesn’t install mysql but I may be wrong.

Don’t worry about that.

Install my_webapp and enable database

Thanks,

  • So, I removed Adminer
  • Installed my_webadmin (including database) and it failed.

Traces available here.

You need to set a password to enable SFTP

Set a password for sftp or disable sftp

2025-05-31 14:36:41,684: WARNING - /var/lib/mysql: found previous version 10.5

You might need to delete this folder or at least move it mv /var/lib/mysql /var/lib/mysql.bak because it could interfere with the mysql installation.