Restore mysql Innodb from filesystem folders

162 Views Asked by At

I have a mysql galera server ( innodb) datadir which got crashed with because of network failure . I am trying to restore the db thru the filesystem . tried innodb_force_recovery flag 1 ,

    [mysqld]
innodb_force_recovery = 1

Started the database

/etc/init.d/mysql start

Database is up but the the logs shows errors.

2022-03-04 11:07:08 139852880054528 [ERROR] mysqld: Table './mysql/user' is marked as crashed and should be repaired
2022-03-04 11:07:08 139852880054528 [Warning] Checking table:   './mysql/user'
2022-03-04 11:07:08 139852880054528 [ERROR] mysql.user: 1 client is using or hasn't closed the table properly
2022-03-04 11:07:08 139852880054528 [ERROR] mysqld: Table './mysql/db' is marked as crashed and should be repaired
2022-03-04 11:07:08 139852880054528 [Warning] Checking table:   './mysql/db'
2022-03-04 11:07:08 139852880054528 [ERROR] mysql.db: 1 client is using or hasn't closed the table properly
2022-03-04 11:07:08 139852878686976 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.

Repaired the table

bash-4.2$ myisamchk -r --update-state /var/lib/mysql/mysql/user.MYI
- recovering (with sort) MyISAM-table '/var/lib/mysql/mysql/user.MYI'
Data records: 15
- Fixing index 1
bash-4.2$  myisamchk -r --update-state /var/lib/mysql/mysql/db.MYI
- recovering (with sort) MyISAM-table '/var/lib/mysql/mysql/db.MYI'
Data records: 18
- Fixing index 1
- Fixing index 2

Restarted the db server

/etc/init.d/mysql start

The db server is coming up . but showing only information_schema database . no other database is listed not even system db like mysql,performance_schema.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.1.24-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.02 sec)

Checked the datadir and the folders and all looks good . Any change in process or different process to get it working?

0

There are 0 best solutions below