[SOLVED] mysql will not start

    • OMV 2.x
    • [SOLVED] mysql will not start

      I had manually installed mysql server (for Kodi) via apt-get.
      All was seemed fine (my Db was working via Kodi and life was good).
      I had installed MySQL Plugin AS WELL (I cannot remember why) but all seemed to be working fine.

      Today, I needed to unmount one drive so began taking the various services offline including mySQL plugin.
      And now the mysql server want start.

      I uninstalled everything using:

      Source Code

      1. dpkg -l | grep -i mysql
      2. mkdir -p /var/lib/mywebsql
      3. apt-get remove --purge mysql\*
      4. apt-get clean
      5. rm -R /var/lib/mysql
      6. rm -R /etc/mysql
      7. dpkg -l | grep -i mysql


      Then, Installed the OMV mysql plugin. Installed went fine.
      But, when I change the plugin settings via the GUI (to change the bind address to OMV's IP address for example) and save & apply, I get an error:



      And the server just does not start.
      If I try to manually start it via command line, I get:

      Source Code

      1. root@OMV:~# /etc/init.d/mysql restart
      2. Stopping MySQL database server: mysqld.
      3. Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
      4. root@OMV:~#
      What is wrong and what can I do to resolve ?

      UPDATE:
      Some how, OMV plugin GUI for MySQL is out of sync with what mysql is actually doing.
      I just checked the processes related to mysql:

      Source Code

      1. root@OMV:~# ps aux | grep mysql | grep -v grep
      2. root 17395 0.0 0.0 4188 656 ? S 16:14 0:00 /bin/sh /usr/bin/mysqld_safe
      3. mysql 17759 0.8 0.5 420776 47732 ? Sl 16:14 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/media/cb48ff4f-08f7-499f-b5ca-9713f8571f49/mysql/ --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
      4. root 17760 0.0 0.0 4096 616 ? S 16:14 0:00 logger -t mysqld -p daemon.error
      5. root@OMV:~#

      Now, if I KILL the mysqld process 17759, then go back to the OMV GUI, I can apply then changes and it starts the sql server.
      If I check the status of mysql, I get an error:


      Source Code

      1. root@OMV:~# /etc/init.d/mysql status
      2. /usr/bin/mysqladmin: connect to server at 'localhost' failed
      3. error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
      4. .
      5. root@OMV:~#
      Not sure if that's the problem ?
      Images
      • Screen Shot 2016-09-20 at 12.58.58.png

        96.7 kB, 844×490, viewed 471 times
      HP Microserver N40L; OMV 2.2.7;

      The post was edited 2 times, last by macnb: Update ().

    • omv 4.0.6 arrakis | 64 bit | 4.12 backports kernel | omvextrasorg 4.1.0
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please don't PM for support... Too many PMs!
    • Thx for the pointers. I found the solution.
      The key was this post #37 followed by this post #47.

      In summary, I had to do the following commands:

      Source Code

      1. mysql_upgrade -u root -p
      2. GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '***********';
      where '***********' is the password in the file /etc/mysql/debian.cnf

      Now the OMV GUI for starting and stopping the MySQL service works and so does the command 'service mysql stop'.

      Many thanks for pointing me in the direction.
      HP Microserver N40L; OMV 2.2.7;

      The post was edited 1 time, last by macnb ().