Ad Widget

Collapse

Database Error after power outage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dafairy
    Junior Member
    • Feb 2017
    • 5

    #1

    Database Error after power outage

    Hi everybody,

    I has a power cut a few days ago and my server went down. I had installed the Zabbix Appliance 3.0, and it has worked great until now...

    I currently have the following message when I try to access the dashboard:

    Database error
    Error connecting to database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    I have tried searching in other threads but couldn't find anything that works. I tried various commands like service mysql start, but none of that seems to do the trick.

    I read somewhere that it could be a problem linked to a lack of space. I did a df -h, and here's the ouput:
    Code:
    Filesystem                   Size  Used Avail Use% Mounted on
    udev                         479M  4.0K  479M   1% /dev
    tmpfs                         99M  388K   99M   1% /run
    /dev/mapper/zabbix--vg-root  7.3G  3.6G  3.4G  53% /
    none                         4.0K     0  4.0K   0% /sys/fs/cgroup
    none                         5.0M     0  5.0M   0% /run/lock
    none                         493M     0  493M   0% /run/shm
    none                         100M     0  100M   0% /run/user
    /dev/sda1                    236M   82M  142M  37% /boot
    I'm a beginner with linux, so any help is really appreciated.

    Thanks in advance !
  • SBO
    Zabbix Certified Specialist
    Zabbix Certified Specialist
    • Sep 2015
    • 226

    #2
    Hi,

    Your MySQL server is not running.
    Try to launch it again and check the logs for any error message.

    Comment

    • dafairy
      Junior Member
      • Feb 2017
      • 5

      #3
      Thanks for your answer SBO.

      I tried going to /var/log/mysql/error.log , but the file is empty.

      Also, running the command to start mysql gives me this result

      Code:
      appliance@zabbix:/etc/mysql$ /etc/init.d/mysql start
      df: '/var/lib/mysql/.': Permission denied
       * /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!
      But it looks like disk space is fine, as seen with df -h (OP)

      Thanks again.

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        just for clarification: you cannot restart a service if you are NOT a root

        So, in your case it better to type:
        Code:
        sudo /etc/init.d/mysql start
        Let us know if it works.
        Also, don't forget to check /var/log/mysql.log.
        It can contain information about your database or any error which stop mysql from starting.
        Sincerely yours,
        Aleksey

        Comment

        • dafairy
          Junior Member
          • Feb 2017
          • 5

          #5
          Hi aib, thanks for your answer !

          Sorry about that, I realized I had to type sudo only after I hit Send.

          Anyway, here's the output:

          Code:
          appliance@zabbix:~$ sudo /etc/init.d/mysql start
          [sudo] password for appliance:
           * Starting MySQL database server mysqld                                                                                                                                                                                                                                              [fail]
          appliance@zabbix:~$
          Also, I just checked the /var/log/mysql.log log file, and it's emtpy...

          Do you have any idea what I should do next ?

          Thanks !

          Comment

          • dafairy
            Junior Member
            • Feb 2017
            • 5

            #6
            Here's an update. I found something in the file /var/log/mysql/error.log


            Code:
            170208 11:03:05 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
            170208 11:03:05 [Note] Plugin 'FEDERATED' is disabled.
            170208 11:03:05 InnoDB: The InnoDB memory heap is disabled
            170208 11:03:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
            170208 11:03:05 InnoDB: Compressed tables use zlib 1.2.8
            170208 11:03:05 InnoDB: Using Linux native AIO
            170208 11:03:05 InnoDB: Initializing buffer pool, size = 128.0M
            170208 11:03:05 InnoDB: Completed initialization of buffer pool
            InnoDB: Error: checksum mismatch in data file ./ibdata1
            170208 11:03:05 InnoDB: Could not open or create data files.
            170208 11:03:05 InnoDB: If you tried to add new data files, and it failed here,
            170208 11:03:05 InnoDB: you should now edit innodb_data_file_path in my.cnf back
            170208 11:03:05 InnoDB: to what it was, and remove the new ibdata files InnoDB created
            170208 11:03:05 InnoDB: in this failed attempt. InnoDB only wrote those files full of
            170208 11:03:05 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
            170208 11:03:05 InnoDB: remove old data files which contain your precious data!
            170208 11:03:05 [ERROR] Plugin 'InnoDB' init function returned error.
            170208 11:03:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
            170208 11:03:05 [ERROR] Unknown/unsupported storage engine: InnoDB
            170208 11:03:05 [ERROR] Aborting
            
            170208 11:03:05 [Note] /usr/sbin/mysqld: Shutdown complete

            I must admit I have no idea what it all means...

            Comment

            • SBO
              Zabbix Certified Specialist
              Zabbix Certified Specialist
              • Sep 2015
              • 226

              #7
              Your DB has been shutdown abruptly and did not like it..
              You have a good tutorial here than can help you : https://rageagainstshell.com/2015/09...ksum-mismatch/

              Comment

              • dafairy
                Junior Member
                • Feb 2017
                • 5

                #8
                Thank you so much for your answer SBO, I got it to work !

                I found this link a bit before your answer, it helped me as well:
                http://stackoverflow.com/questions/3...-linode-server

                Thank you again !

                Comment

                • SBO
                  Zabbix Certified Specialist
                  Zabbix Certified Specialist
                  • Sep 2015
                  • 226

                  #9
                  You're welcome

                  Comment

                  Working...