Ahojte
Po nestastnom restarte servera nam prestala fungovat DB
root@dohlad1:/home/michal# systemctl status mariadb.service
â—Ź mariadb.service - MariaDB 10.1.48 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: signal) since Sun 2021-07-18 07:15:17 CEST; 1s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 718 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 708 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 26701 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)
Process: 26625 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && syst
Process: 26621 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 26618 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 26701 (code=killed, signal=ABRT)
Status: "InnoDB: Error: Attempted to open a previously opened tablespace. Previous tablespace dohlad1/hstgrp uses space ID: 7 at filepath: ./dohlad1/hstgrp
Jul 18 07:15:17 dohlad1 systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
Jul 18 07:15:17 dohlad1 systemd[1]: Failed to start MariaDB 10.1.48 database server.
Jul 18 07:15:17 dohlad1 systemd[1]: mariadb.service: Unit entered failed state.
Jul 18 07:15:17 dohlad1 systemd[1]: mariadb.service: Failed with result 'signal'.
Spravil som zalohu celeho servera
a ked vymazem adresar rm -r /var/lib/mysql/dohlad1
tak potom DB sa my rozbehne
root@dohlad1:/home/michal# /etc/init.d/mysql start
[ ok ] Starting mysql (via systemctl): mysql.service.
Snazil som sa nejak na PC rozbehat DB zo suborov ale neslo to. Nejak som si nespravil priamo dump SQL.
Vytvoril som novu DB, kde som naimportoval prazdnu DB aplikacie.
Potom som tam nakopiroval potrebne subory ibd. Je ich asi 290
Ale aj tak sa mi stale to tvari ako keby dana DB bola bez dat
skusil som spravit nasledovný príkaz, len ukazka par riadkov nech to nedavam celé
oot@dohlad1:/home/michal# myisamchk /var/lib/mysql/dohlad2/*
myisamchk: error: '/var/lib/mysql/dohlad2/acknowledges.frm' is not a MyISAM-table
---------
myisamchk: error: '/var/lib/mysql/dohlad2/acknowledges.ibd' is not a MyISAM-table
---------
myisamchk: error: '/var/lib/mysql/dohlad2/actions.frm' is not a MyISAM-table
---------
myisamchk: error: '/var/lib/mysql/dohlad2/actions.ibd' is not a MyISAM-table
.......
Potom som skusil nasledovné
MariaDB [(none)]> use dohlad2
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1813 (HY000): Tablespace for table 'history' exists. Please DISCARD the tablespace before IMPORT.
MariaDB [dohlad2]> ALTER TABLE history discard TABLESPACE;
Query OK, 0 rows affected (0.01 sec)
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'dohlad2.history' doesn't exist in engine
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'dohlad2.history' doesn't exist in engine
MariaDB [dohlad2]> ALTER TABLE history discard TABLESPACE;
Query OK, 0 rows affected, 1 warning (0.01 sec)
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'dohlad2.history' doesn't exist in engine
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'dohlad2.history' doesn't exist in engine
MariaDB [dohlad2]> ALTER TABLE history IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'dohlad2.history' doesn't exist in engine
MariaDB [dohlad2]> REPAIR TABLE history
-> ;
+-----------------+--------+----------+---------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------+--------+----------+---------------------------------------------------------+
| dohlad2.history | repair | note | The storage engine for the table doesn't support repair |
+-----------------+--------+----------+---------------------------------------------------------+
1 row in set (0.00 sec)
MariaDB [dohlad2]> REPAIR TABLE history;
+-----------------+--------+----------+---------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------+--------+----------+---------------------------------------------------------+
| dohlad2.history | repair | Warning | Tablespace has been discarded for table 'history' |
| dohlad2.history | repair | note | The storage engine for the table doesn't support repair |
+-----------------+--------+----------+---------------------------------------------------------+
2 rows in set (0.00 sec)
MariaDB [dohlad2]> REPAIR TABLE action;
+----------------+--------+----------+--------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------------+--------+----------+--------------------------------------+
| dohlad2.action | repair | Error | Table 'dohlad2.action' doesn't exist |
| dohlad2.action | repair | status | Operation failed |
+----------------+--------+----------+--------------------------------------+
2 rows in set (0.00 sec)
MariaDB [dohlad2]> REPAIR TABLE actions;
+-----------------+--------+----------+---------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------+--------+----------+---------------------------------------------------------+
| dohlad2.actions | repair | note | The storage engine for the table doesn't support repair |
+-----------------+--------+----------+---------------------------------------------------------+
1 row in set (0.00 sec)
Viete nejak poradit ako opravit DB,
Za kazdu radu vopred Ďakujem
Michal