Want to subscribe to topics you're interested in?
Become a Member

MariaDB Cant Start Mariadb

Discussion in 'MariaDB & General MySQL news & discussions' started by skringjer, May 20, 2020.

  1. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    Greetings everyone and @eva2000

    Suddenly i cant start my MariaDB server and i get this error on systemctl status mariadb.service

    Code:
    ● mariadb.service - MariaDB 10.3.23 database server
       Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/mariadb.service.d
               └─migrated-from-my.cnf-settings.conf, openfileslimit.conf, protecthome.conf
       Active: failed (Result: exit-code) since Tue 2020-05-19 14:51:18 UTC; 21s ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 4862 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
      Process: 4581 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
      Process: 4577 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
     Main PID: 4862 (code=exited, status=1/FAILURE)
       Status: "MariaDB server is down"
    
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [ERROR] Plugin 'InnoDB' init function returned error.
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGI...ailed.
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [Note] Plugin 'FEEDBACK' is disabled.
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [ERROR] Unknown/unsupported storage engine: InnoDB
    May 19 14:51:18 hostname.domain.com mysqld[4862]: 2020-05-19 14:51:18 0 [ERROR] Aborting
    May 19 14:51:18 hostname.domain.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
    May 19 14:51:18 hostname.domain.com systemd[1]: Failed to start MariaDB 10.3.23 database server.
    May 19 14:51:18 hostname.domain.com systemd[1]: Unit mariadb.service entered failed state.
    May 19 14:51:18 hostname.domain.com systemd[1]: mariadb.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.
    
    /var/mysqld.log is empty

    Any help would be appreciated.
     
  2. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    I searched on forums and mainly the fix is to delete these two

    rm /var/lib/mysql/ib_logfile0 rm
    /var/lib/mysql/ib_logfile1

    I deleted them but still the same issue.
     
  3. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    Sorry the issue has been fixed, i had to delete another file

    rm /var/lib/mysql/ibdata1
     
  4. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    But now i cant access my site,

    And when i log in my Phpmyadmin i see the size = inuse Screenshot
     
  5. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    I think the Innodb engine isnt started, because these are Innodb tables, any help please.
     
  6. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    6:37 PM
    And when i click on the table it gives this error Screenshot
     
  7. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:37 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ibdata1 contains some of your MySQL innodb databases' data and innodb per file mapping etc. You should never delete ibdata1 !. If you have full database backups for all databases including mysql system database for the server, you should instead restore to the most recent backups for all databases and mysql system database instead.

    But I'd backup /var/lib/mysql directory with MySQL server stopped and keep it in a safe place untouched so you can in future perform other recovery processes on the data if you want to attempt to restore the data mappings lost from deleting ibdata1 i.e. rebuild databases schema/structure from per innodb file *.frm definition files.

    Unfortunately the damage done by deleting ibdata1, is something I wouldn't be able to provide free support for. You'd need to hire someone to fix this if possible. And that is provided you have a backup for all databases including mysql system database and also provided all your MySQL data was in per innodb file format (if not then data for that database would be in ibdata1 and wouldn't have a frm definition file to restore/rebuild from).