ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    MySQL db refusing to start after Ubuntu 16.04.1 reboot

    IT Discussion
    4
    24
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NashBrydgesN
      NashBrydges
      last edited by

      I have mysql recently installed on an Ubuntu 16.04.1 server and have been testing the application for the last couple of days without issue. I updated Ubuntu (mysql didn't require any updates - it is a recent install so it's already current) and after the update and a reboot, mysql refuses to start. I'm new to mysql so I'm hoping someone here can help me figure out why it isn't starting up.

      service mysql status output:

      ● mysql.service - MySQL Community Server`
         Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
         Active: activating (start-post) (Result: exit-code) since Sat 2017-02-11 11:54:54 EST; 27s ago
        Process: 3129 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
        Process: 3126 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
       Main PID: 3129 (code=exited, status=1/FAILURE);         : 3135 (mysql-systemd-s)
          Tasks: 2
         Memory: 332.0K
            CPU: 519ms
         CGroup: /system.slice/mysql.service
                 └─control
                   ├─3135 /bin/bash /usr/share/mysql/mysql-systemd-start post
                   └─3723 sleep 1
      
      Feb 11 11:54:54 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
      Feb 11 11:54:54 REDACTED systemd[1]: Stopped MySQL Community Server.
      Feb 11 11:54:54 REDACTED systemd[1]: Starting MySQL Community Server...
      Feb 11 11:54:58 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
      

      Looking at journalctl -xe reveals:

      -- The result is failed.
      Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Unit entered failed state.
      Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Failed with result 'exit-code'.
      Feb 11 12:05:04 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
      Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:84): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" d
      Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:85): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=6321 comm="mysqld" requested_ma
      Feb 11 12:05:04 REDACTED kernel: audit: type=1400 audit(1486832704.624:86): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" d
      Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 ouid=117
      Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 o
      Feb 11 12:05:04 REDACTED audit[6321]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/6321/status" pid=6321 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=117 ouid=117
      Feb 11 12:05:04 REDACTED systemd[1]: Stopped MySQL Community Server.
      -- Subject: Unit mysql.service has finished shutting down
      -- Defined-By: systemd
      -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
      --
      -- Unit mysql.service has finished shutting down.
      Feb 11 12:05:04 REDACTED systemd[1]: Starting MySQL Community Server...
      -- Subject: Unit mysql.service has begun start-up
      -- Defined-By: systemd
      -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
      --
      -- Unit mysql.service has begun starting up.
      Feb 11 12:05:06 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
      

      Can't figure out why it's is being denied startup by apparmor. Any ideas on where to go next to get this thing started?

      1 Reply Last reply Reply Quote 0
      • DustinB3403D
        DustinB3403
        last edited by

        What does journalctl -xe have to say?

        NashBrydgesN 2 Replies Last reply Reply Quote 0
        • NashBrydgesN
          NashBrydges @DustinB3403
          last edited by

          @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

          What does journalctl -xe have to say?

          I've posted that output in my original post. It's at the bottom of the post.

          1 Reply Last reply Reply Quote 0
          • NashBrydgesN
            NashBrydges @DustinB3403
            last edited by

            @DustinB3403 It basically shows apparmor is denying mysql startup.

            DustinB3403D 1 Reply Last reply Reply Quote 0
            • DustinB3403D
              DustinB3403 @NashBrydges
              last edited by

              @NashBrydges How is this mySQL system being run, with sudo?

              NashBrydgesN 1 Reply Last reply Reply Quote 0
              • NashBrydgesN
                NashBrydges @DustinB3403
                last edited by

                @DustinB3403 Correct. To start I used "sudo service mysql status" and this is where I discovered it wasn't running.

                1 Reply Last reply Reply Quote 0
                • DustinB3403D
                  DustinB3403
                  last edited by

                  It looks to me like a dependency was removed when you upgraded.

                  Process: 3129 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)

                  NashBrydgesN 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller
                    last edited by

                    I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?

                    NashBrydgesN 1 Reply Last reply Reply Quote 0
                    • NashBrydgesN
                      NashBrydges @DustinB3403
                      last edited by

                      @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                      /usr/sbin/mysqld

                      Just checked. There is no file named "/usr/sbin/mysqld"

                      DustinB3403D 2 Replies Last reply Reply Quote 0
                      • NashBrydgesN
                        NashBrydges @scottalanmiller
                        last edited by

                        @scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                        I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?

                        Installed from "sudo apt-get install mysql-server"

                        scottalanmillerS 1 Reply Last reply Reply Quote 0
                        • DustinB3403D
                          DustinB3403 @NashBrydges
                          last edited by

                          @NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                          @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                          /usr/sbin/mysqld

                          Just checked. There is no file named "/usr/sbin/mysqld"

                          Did you create a user outside of root on this system? If so check under that user account.

                          NashBrydgesN 1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @NashBrydges
                            last edited by

                            @NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                            @scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                            I thought that Ubuntu came with MariaDB, not MySQL. Where did you get MySQL?

                            Installed from "sudo apt-get install mysql-server"

                            Oh okay, maybe they didn't switch. I run my databases on CentOS so might have missed that they hung back on MySQL.

                            1 Reply Last reply Reply Quote 0
                            • DustinB3403D
                              DustinB3403 @NashBrydges
                              last edited by

                              @NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                              @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                              /usr/sbin/mysqld

                              Just checked. There is no file named "/usr/sbin/mysqld"

                              The fact that you don't see the path means that either your running under the wrong account (don't have permission) or that something was removed.

                              NashBrydgesN 1 Reply Last reply Reply Quote 0
                              • NashBrydgesN
                                NashBrydges @DustinB3403
                                last edited by

                                @DustinB3403 I created a new user with select, update, insert delete privs on a new database within mysql but there nothing under any other users anywhere. I've been using this user for the past 2 days and it worked well.

                                I should mention that mysql is running on the standard port and nothing has been changed on the mysqld.cnf file.

                                1 Reply Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller
                                  last edited by

                                  Can you try this...

                                  sudo apt-get install apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils
                                  

                                  See if that does anything?

                                  NashBrydgesN 1 Reply Last reply Reply Quote 0
                                  • NashBrydgesN
                                    NashBrydges @DustinB3403
                                    last edited by

                                    @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                                    @NashBrydges said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                                    @DustinB3403 said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                                    /usr/sbin/mysqld

                                    Just checked. There is no file named "/usr/sbin/mysqld"

                                    The fact that you don't see the path means that either your running under the wrong account (don't have permission) or that something was removed.

                                    The root account still existed in the mysql.user table, along with the debian maintenance account that is setup during install. I added a new underpriviledged user to the mysql.user table but not to the server. Thatis still running under the only account that exists.

                                    1 Reply Last reply Reply Quote 0
                                    • NashBrydgesN
                                      NashBrydges @scottalanmiller
                                      last edited by

                                      @scottalanmiller said in MySQL db refusing to start after Ubuntu 16.04.1 reboot:

                                      Can you try this...

                                      sudo apt-get install apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils
                                      

                                      See if that does anything?

                                      This did install additional packages but mysql service still isn't starting however this time the output of journalctl -xe shows:

                                      -- Subject: Unit mysql.service has failed
                                      -- Defined-By: systemd
                                      -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
                                      --
                                      -- Unit mysql.service has failed.
                                      --
                                      -- The result is failed.
                                      Feb 11 12:42:35 REDACTED systemd[1]: mysql.service: Unit entered failed state.
                                      Feb 11 12:42:35 REDACTED systemd[1]: mysql.service: Failed with result 'exit-code'.
                                      Feb 11 12:42:35 REDACTED systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
                                      Feb 11 12:42:35 REDACTED systemd[1]: Stopped MySQL Community Server.
                                      -- Subject: Unit mysql.service has finished shutting down
                                      -- Defined-By: systemd
                                      -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
                                      --
                                      -- Unit mysql.service has finished shutting down.
                                      Feb 11 12:42:35 REDACTED systemd[1]: Starting MySQL Community Server...
                                      -- Subject: Unit mysql.service has begun start-up
                                      -- Defined-By: systemd
                                      -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
                                      --
                                      -- Unit mysql.service has begun starting up.
                                      Feb 11 12:42:37 REDACTED systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
                                      

                                      This seems even more cryptic than the first output.

                                      1 Reply Last reply Reply Quote 0
                                      • NashBrydgesN
                                        NashBrydges
                                        last edited by

                                        Ok, I started looking into the error.log file to get more info about what was happening. I found that there was an error about not being able to load something but the log file was pretty large so I created a new log file to replace this one and went to restart mysql so I would have the one attempt's worth of records to review. To my surprise, after having provided a new error.log file, mysql started up no problem. Not sure wtf that was all about or why it failed with the current error.log contents.

                                        I'm removing mysql and starting from scratch to see if I can replicate the issue.

                                        1 Reply Last reply Reply Quote 2
                                        • scottalanmillerS
                                          scottalanmiller
                                          last edited by

                                          That's a weird one!

                                          DustinB3403D 1 Reply Last reply Reply Quote 0
                                          • DustinB3403D
                                            DustinB3403 @scottalanmiller
                                            last edited by

                                            @scottalanmiller Why the heck would a log file stop a service from loading?!

                                            NashBrydgesN 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post