MySQL server not started automatically after OMV is started

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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) :



      It is enabled as shown on the mysql page :


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

      Source Code

      1. root@OMV:~# systemctl status mysql
      2. ● mysql.service - LSB: Start and stop the mysql database server daemon
      3. Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
      4. Active: failed (Result: exit-code) since Wed 2019-02-06 11:45:44 GMT; 1h 57min ago
      5. Docs: man:systemd-sysv-generator(8)
      6. CGroup: /system.slice/mysql.service
      7. ├─1111 /bin/bash /usr/bin/mysqld_safe
      8. ├─1315 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/x86_64-linux-gnu/mariadb18/plugin --user=mysql
      9. --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
      10. └─1316 logger -t mysqld -p daemon error
      11. Feb 06 11:45:44 OMV systemd[1]: mysql.service: Unit entered failed state.
      12. Feb 06 11:45:44 OMV systemd[1]: mysql.service: Failed with result 'exit-code'.
      13. Feb 06 11:46:05 OMV mysqld[1316]: 2019-02-06 11:46:05 139648118698432 [Note] InnoDB: 128 rollback segment(s) are active.
      14. Feb 06 11:46:05 OMV mysqld[1316]: 2019-02-06 11:46:05 139648118698432 [Note] InnoDB: Waiting for purge to start
      15. Feb 06 11:46:05 OMV mysqld[1316]: 2019-02-06 11:46:05 139648118698432 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.41-84
      16. .1 started; log sequence number 9730359
      17. Feb 06 11:46:07 OMV mysqld[1316]: 2019-02-06 11:46:07 139647556511488 [Note] InnoDB: Dumping buffer pool(s) not yet started
      18. Feb 06 11:46:07 OMV mysqld[1316]: 2019-02-06 11:46:07 139648118698432 [Note] Plugin 'FEEDBACK' is disabled.
      19. Feb 06 11:46:08 OMV mysqld[1316]: 2019-02-06 11:46:08 139648118698432 [Note] Server socket created on IP: '192.168.15.200'.
      20. Feb 06 11:46:12 OMV mysqld[1316]: 2019-02-06 11:46:12 139648118698432 [Note] /usr/sbin/mysqld: ready for connections.
      21. Feb 06 11:46:12 OMV mysqld[1316]: Version: '10.1.37-MariaDB-0+deb9u1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Debian 9.6
      22. root@OMV:~#
      Display All


      When I disable the service (and apply changes), I get:


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


      Source Code

      1. root@OMV:~# systemctl status mysql
      2. ● mysql.service - LSB: Start and stop the mysql database server daemon
      3. Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
      4. Active: active (running) since Wed 2019-02-06 14:09:38 GMT; 14s ago
      5. Docs: man:systemd-sysv-generator(8)
      6. Process: 13933 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
      7. Tasks: 29 (limit: 4915)
      8. CGroup: /system.slice/mysql.service
      9. ├─1111 /bin/bash /usr/bin/mysqld_safe
      10. ├─1315 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/x86_64-linux-gnu/mariadb18/plugin --user=mysql
      11. --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
      12. └─1316 logger -t mysqld -p daemon error
      13. Feb 06 14:09:37 OMV systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
      14. Feb 06 14:09:38 OMV mysql[13933]: Starting MariaDB database server: mysqld already running.
      15. Feb 06 14:09:38 OMV systemd[1]: Started LSB: Start and stop the mysql database server daemon.
      16. root@OMV:~#
      Display All


      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 ?
      HP Microserver N40L; OMV 4.1.18-2;
    • 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 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      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.
      HP Microserver N40L; OMV 4.1.18-2;
    • I just saw upgrade and missed the fresh install part. Is it using an existing database?
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • macnb wrote:

      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.

      macnb wrote:

      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 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      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:

      Source Code

      1. 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:

      Source Code

      1. sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
      2. sudo apt-get autoremove -y
      3. sudo apt-get autoclean
      4. rm -rf /etc/mysql
      5. 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:

      Source Code

      1. gunzip < alldb.sql.gz | mysql -u root -p
      Then, created Kodi user by entering entering following sql commands:

      Source Code

      1. root@OMV:~# mysql -u root -p
      2. Enter password:
      3. Welcome to the MariaDB monitor. Commands end with ; or \g.
      4. Your MariaDB connection id is 52
      5. Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6
      6. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
      7. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      8. MariaDB [(none)]> CREATE USER 'kodi' IDENTIFIED BY 'kodi';
      9. Query OK, 0 rows affected (0.00 sec)
      10. MariaDB [(none)]> GRANT ALL ON *.* TO 'kodi';
      11. Query OK, 0 rows affected (0.00 sec)
      12. MariaDB [(none)]> flush privileges;
      13. Query OK, 0 rows affected (0.00 sec)
      14. MariaDB [(none)]> quit
      15. Bye
      16. root@OMV:~#
      Display All
      Restarted OMV and now MySQL service is always running on restart.
      The mysql status shows:

      Source Code

      1. root@OMV:~# systemctl status mysql
      2. ● mysql.service - LSB: Start and stop the mysql database server daemon
      3. Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
      4. Active: active (running) since Thu 2019-02-07 23:33:22 GMT; 24min ago
      5. Docs: man:systemd-sysv-generator(8)
      6. Tasks: 30 (limit: 4915)
      7. Memory: 276.7M
      8. CPU: 12.375s
      9. CGroup: /system.slice/mysql.service
      10. ├─28638 /bin/bash /usr/bin/mysqld_safe
      11. ├─28788 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/x86_64-linux-gnu/mariadb18/plugin --user=mysq
      12. l --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
      13. └─28789 logger -t mysqld -p daemon error
      14. Feb 07 23:33:22 OMV mysqld[28789]: 2019-02-07 23:33:22 140368398160320 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.41-8
      15. 4.1 started; log sequence number 1616737
      16. Feb 07 23:33:22 OMV mysqld[28789]: 2019-02-07 23:33:22 140368398160320 [Note] Plugin 'FEEDBACK' is disabled.
      17. Feb 07 23:33:22 OMV mysqld[28789]: 2019-02-07 23:33:22 140367735289600 [Note] InnoDB: Dumping buffer pool(s) not yet started
      18. Feb 07 23:33:22 OMV mysqld[28789]: 2019-02-07 23:33:22 140368398160320 [Note] Server socket created on IP: '192.168.15.200'.
      19. Feb 07 23:33:22 OMV mysqld[28789]: 2019-02-07 23:33:22 140368398160320 [Note] /usr/sbin/mysqld: ready for connections.
      20. Feb 07 23:33:22 OMV mysqld[28789]: Version: '10.1.37-MariaDB-0+deb9u1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Debian 9.6
      21. Feb 07 23:33:22 OMV mysql[28611]: Starting MariaDB database server: mysqld.
      22. Feb 07 23:33:22 OMV systemd[1]: Started LSB: Start and stop the mysql database server daemon.
      23. Feb 07 23:33:25 OMV /etc/mysql/debian-start[28853]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
      24. Feb 07 23:33:25 OMV /etc/mysql/debian-start[28853]: Looking for 'mysql' as: /usr/bin/mysql
      25. root@OMV:~#
      Display All
      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.
      HP Microserver N40L; OMV 4.1.18-2;
    • macnb wrote:

      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.

      macnb wrote:

      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.

      macnb wrote:

      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 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      macnb wrote:

      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.

      macnb wrote:

      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.

      macnb wrote:

      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.

      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.
      HP Microserver N40L; OMV 4.1.18-2;
    • macnb wrote:


      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.
      Build, Learn, Create.

      How to Videos for OMV

      Post any questions to the forum, so others can benefit from your curiosity. :thumbsup:
      No private support.
    • macnb wrote:

      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 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • TechnoDadLife wrote:

      macnb wrote:

      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.
      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 :)
      HP Microserver N40L; OMV 4.1.18-2;
    • ryecoaaron wrote:

      macnb wrote:

      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.
      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 ?
      HP Microserver N40L; OMV 4.1.18-2;
    • macnb wrote:

      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 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      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.
      Build, Learn, Create.

      How to Videos for OMV

      Post any questions to the forum, so others can benefit from your curiosity. :thumbsup:
      No private support.
    • Users Online 1

      1 Guest