[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:

    dpkg -l | grep -i mysql
    mkdir -p /var/lib/mywebsql
    apt-get remove --purge mysql\*
    apt-get clean
    rm -R /var/lib/mysql
    rm -R /etc/mysql
    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:

    root@OMV:~# /etc/init.d/mysql restart
    Stopping MySQL database server: mysqld.
    Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

    What is wrong and what can I do to resolve ?

    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:

    root@OMV:~# ps aux | grep mysql | grep -v grep
    root 17395 0.0 0.0 4188 656 ? S 16:14 0:00 /bin/sh /usr/bin/mysqld_safe
    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
    root 17760 0.0 0.0 4096 616 ? S 16:14 0:00 logger -t mysqld -p daemon.error

    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:

    root@OMV:~# /etc/init.d/mysql status
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

    Not sure if that's the problem ?

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

    mysql_upgrade -u root -p
    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.

Participate now!

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