C
C
Crash2018-05-22 10:22:08
MySQL
Crash, 2018-05-22 10:22:08

Why are there problems with importing a database from a dump?

So, the situation is as follows:
There is a database with a couple of dozen tables and many records in them, its dump weighs about 300 MB.
I need to create a copy of this DB on the same server. Accordingly, I made a dump and now I'm trying to import it into a new, freshly created database.
Tried both through MySQL Workbench and through the console. The process goes as expected, progress is being drawn, time passes. No errors appear.
But when the import ends, there are no tables in the new database at all. As if the import really was, but went the wrong way.
Why can this happen? The encodings in the source and destination are the same, the base is working and is actually used, there were no errors during the export either. There is enough memory on the server.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vyacheslav Rakhinsky, 2018-05-22
@Bandicoot

Apparently, the dump contains the creation of a database (CREATE DATABASE .. IF NOT EXIST) and, accordingly, the name, show the first 20-30 lines of the dump
. You are most likely uploading the dump back to the old database and losing the database changes made since the dump was created

A
Artem, 2018-05-22
@devspec

Most likely, the transaction is not fixed.
For export-import, it is best to use specialized tools like https://sypex.net/ or, at worst, mysqldump - but not MySQL Workbench and other clients .
There are a lot of nuances when restoring a dump - from the correct order of restoring sequences and indexes to observing timeouts and placing a certain portion of data in a transaction, and not the entire table.

R
Ruslan Fedoseev, 2018-05-22
@martin74ua


religion does not allow you to restore a dump from a shell with a command ?

A
Alex-1917, 2018-05-22
@alex-1917

On an adequate hosting, a copy of the database is made with one button)))) On a cheap hosting, you have to invent a rake
, sit on the Toaster and take our precious time ...)))) pours 10-gigabyte databases with a half kick, a bunch of formats for import-export, a query builder, etc. The only negative is that .de)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question