A
A
Alexander2021-08-05 17:31:45
MySQL
Alexander, 2021-08-05 17:31:45

How to restore a database from raw table files?

You need to restore the database, but there is no dump. There are raw table files from /var/lib/mariadb-10.3/fran/
I have 10.6.3-MariaDB

I tried in the forehead - I created the fran database of the same name. I stopped the server, deleted the contents of /var/lib/mysql/fran and copied the files I have there. Started the server.

The database is seen, the tables all appeared in it, but the site gives out:

[Bitrix\Main\DB\SqlQueryException] 
Mysql query error: (1932) Table 'fran.b_option' doesn't exist in engine (400)

        SELECT NAME, VALUE 
        FROM b_option 
        WHERE MODULE_ID = 'main'


What can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-08-06
Madzhugin @Suntechnic

I asked myself - I answer myself:
You will need not only database files, but also ib_logfile0 and ib_logfile1 files.
In general, if there is a folder for the entire database, then the easiest way I went:
1 Create a separate mysql/mariadb
server 2 Stop the server
3 Replace the server folder with the one you have (I used /var/lib/mysql, the contents of which I replaced with the contents of /var/lib/mariadb-10.3)
4 Correct the rights recursively on the folder.
5 Start the database server
6 Merge the desired database through mysqldump
Rejoice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question