MySQL server not started automatically after OMV is started

  • Recently upgraded from 2.x to 4.x (fresh install).
    Installed the all the various plugins including mysql.
    recreated my databases.
    All working great.


    When the server is powered and restarted the following day, the Dashboard shows the mysql service is NOT running (see attached) :


    Screenshot 2019-02-06 at 13.43.21.png


    It is enabled as shown on the mysql page :
    Screenshot 2019-02-06 at 13.53.15.png


    If I run "systemctl status mysql" it shows a problem:


    When I disable the service (and apply changes), I get:
    Screenshot 2019-02-06 at 14.07.11.png


    Then, I re-enable the service (again I get the same "An error occured" popup) and run the status command:




    And everything seems to work.
    It seems the mysql server was already running but the OMV dashboard GUI was mis-reporting as not-running.
    Any idea what's wrong and how to solve it ?

  • Probably because mysql is upgraded to mariadb in OMV 4.x (Debian's choice). So, the config file is not correct. I would try omv-mkconf mysql and reboot again. You should also start planning to use docker for mysql because the plugin won't exist in OMV 5.x - Why should you use or not use dockers

    omv 5.5.2 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Probably because mysql is upgraded to mariadb in OMV 4.x (Debian's choice). So, the config file is not correct. I would try omv-mkconf mysql and reboot again. You should also start planning to use docker for mysql because the plugin won't exist in OMV 5.x - Why should you use or not use dockers

    Thx for the quick reply.
    But I did a clean install of OMV 4.x and clean install of the plugins and it's using MariaDb.

  • Then, I re-enable the service (again I get the same "An error occured" popup)

    This happens because nginx is restart. Not a real error.


    While I was running 2.x, I exported the database.
    Then I did a clean install of 4.x, plugins, etc and imported the database into Mariadb.

    I can't explain why it doesn't start. My test VM doesn't have this issue.

    omv 5.5.2 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I solved the problem (by uninstalling & re-installing MySQL).


    I first backed up all the databases using:

    Code
    mysqldump -u root -p --events --single-transaction --quick --all-databases | gzip > alldb.sql.gz

    Then, I uninstalled the OMV MySQL plugin.
    Then, just to be sure that MySQL was removed, I manually ran the following:

    Code
    sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
    sudo apt-get autoremove -y
    sudo apt-get autoclean
    rm -rf /etc/mysql
    sudo find / -iname 'mysql*' -exec rm -rf {} \;

    Then, I rebooted OMV and installed the OMV MySQL plugin.
    Then, imported the exiting databases back into MySQL using:

    Code
    gunzip < alldb.sql.gz | mysql -u root -p

    Then, created Kodi user by entering entering following sql commands:

    Restarted OMV and now MySQL service is always running on restart.
    The mysql status shows:


    All good now.


    BTW, I did at look at Installing Docker + MariaDB container but for my usage, that does not make sense as I needed a system-wide database and not a "virtual database container" for linking with another "virtual App" like Nextcloud.
    Also Docker GUI on OMV is not yet intuitive enough for prime-time.
    So I sincerely hope MySQL plugin is NOT removed from OMV 5.x.

  • BTW, I did at look at Installing Docker + MariaDB container but for my usage, that does not make sense as I needed a system-wide database and not a "virtual database container" for linking with another "virtual App" like Nextcloud.

    mariadb in a container is no different than the plugin and can still be a system-wide database. Docker isn't virtualization. So it will work for Nextcloud AND Kodi or whatever you want. You could even have a different mysql/mariadb docker for each database.


    Also Docker GUI on OMV is not yet intuitive enough for prime-time.

    In order to have the flexibility needed, the GUI has to be somewhat complex. Watch a few videos about it and it will become easier.


    So I sincerely hope MySQL plugin is NOT removed from OMV 5.x.

    I won't be porting it. So, I don't know how it is going to make it to OMV 5.x in that case.

    omv 5.5.2 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • mariadb in a container is no different than the plugin and can still be a system-wide database. Docker isn't virtualization. So it will work for Nextcloud AND Kodi or whatever you want. You could even have a different mysql/mariadb docker for each database.

    In order to have the flexibility needed, the GUI has to be somewhat complex. Watch a few videos about it and it will become easier.

    I won't be porting it. So, I don't know how it is going to make it to OMV 5.x in that case.


    OK. Bit the bullet and learnt a bit more about Docker.
    Though they are not technically a VM, they (Containers) produce a "contained virtual" OS environment to run a specific service or App under a Host OS.


    So, I uninstalled the myql Plugin and installed the MariaDB Docker in network mode (using --network my-docker-net as Extra Args) and made it work for the existing Kodi clients (after importing their DB's).


    Many of the video's by @TechnoDadLife showing MariaDB being used "inefficiently" (in my opinion). For example, one copy of MariaDB bound with Nextcloud running on the same server with another copy of MariaDB bound with Lychee. That means that are two instances of mariadb containers instead of one container managing two databases within it. That's 700MB of containers instead of 350MB for one.


  • So, I uninstalled the myql Plugin and installed the MariaDB Docker in network mode (using --network my-docker-net as Extra Args) and made it work for the existing Kodi clients (after importing their DB's).


    Many of the video's by @TechnoDadLife showing MariaDB being used "inefficiently" (in my opinion). For example, one copy of MariaDB bound with Nextcloud running on the same server with another copy of MariaDB bound with Lychee. That means that are two instances of mariadb containers instead of one container managing two databases within it. That's 700MB of containers instead of 350MB for one.

    Hi Macnb,


    You are assuming a lot here. I install MariaDB for each video, because not everyone has mariadb installed or knows how to use it. Of course, you can reuse the container. Just name each new instance a new name.
    Watch any video and remember it is geared towards someone who knows nothing.


    My most complicated video, installing Nextcloud is my most watched video. Most people who install OMV, the first thing they want to do is install Nextcloud even though I tell them to try other things first.


    So how can you help? Can you write a guide about setting up Kodi with MariaDB. I think some people might find that helpful.

  • That means that are two instances of mariadb containers instead of one container managing two databases within it. That's 700MB of containers instead of 350MB for one.

    Not quite. Docker dedupes. So, a second container only uses extra space for bytes that are different from the image. Since the database itself is not stored on the image, very little will change from the initial image.

    omv 5.5.2 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Hi Macnb,
    You are assuming a lot here. I install MariaDB for each video, because not everyone has mariadb installed or knows how to use it. Of course, you can reuse the container. Just name each new instance a new name.
    Watch any video and remember it is geared towards someone who knows nothing.


    My most complicated video, installing Nextcloud is my most watched video. Most people who install OMV, the first thing they want to do is install Nextcloud even though I tell them to try other things first.


    So how can you help? Can you write a guide about setting up Kodi with MariaDB. I think some people might find that helpful.

    I appreciate that your videos are aimed at folks who may not know all the details (I do not). They are great and I have learnt from them too.


    You wrote "Just name each new instance a new name." which was my point of duplicating Containers.
    Each instance is 350MB (in case of Mariadb). That's OK in large commercial farms with plenty of resources.
    Anyone new to docker would get the impression that one has to have a separate database service for each new web/app service they wish to add.
    Of course that's the easier to describe and setup.


    When you do another video that needs a database for the new service, would it be worth pointing out that you can actually use an exiting mariadb container for the new service ?


    Re helping out, I'll try to write something up regarding using one database container for two apps (Kodi + Nextcloud). May be I'll send it to you first to check it :)

  • Not quite. Docker dedupes. So, a second container only uses extra space for bytes that are different from the image. Since the database itself is not stored on the image, very little will change from the initial image.

    Sorry I did not see your post before I replied to @TechnoDadLife. I'm having a lot of problems using these forums (i'll report it somewhere soon).


    So what you are saying is that Virtual Size of the Image (the amount of data used for the read-only image data) used by the Container is constant and multiple Containers may share some or all the read-only image data ?

  • So what you are saying is that Virtual Size of the Image (the amount of data used for the read-only image data) used by the Container is constant and multiple Containers may share some or all the read-only image data ?

    It isn't quite constant because there may be a little bit of data inside each new container that changes but it shouldn't be very much. Yes, multiple containers share all of the read-only image data until bytes change.

    omv 5.5.2 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Maybe a better way of putting this is...


    Say you are using a word processor.


    Each time you use the word processor, you don't install a new copy of the word processor. You can just open a a new document and give it a different name. Dockers work the same way.


    You can download one docker image and reuse it many times giving each container a new name.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!