Import Dump
graph LR
A[MySQL Workbench] --> |:3307| C[(Data Database)];
A user wants to import a database dump in .sql
(or in .sql.gz
) format into DBRepo.
UI¶
Import the database dump dump.sql
via the MySQL Workbench client which is
semi-compatible with MariaDB databases, i.e. core features work some status/performance features do not.
Setup a new connection in the MySQL Workbench by clicking the small
"" button to open the dialog. In the opened dialog
fill out the connection parameters (for local deployments the hostname is 127.0.0.1
and port 3307
for the
Data Database .
The default credentials are username root
and password dbrepo
, type the password in
and click the "OK" button. Then finish the setup of the new connection by
clicking the "OK" button .
Now you should be able to see some statistics for the Data Database, especially that it is running and basic connection and version information .
Then proceed to import the database dump dump.sql
by clicking "Data Import/Restore"
and select "Import from Self-Contained File" in the Import Options. Then
select the dump.sql
file in the file path selection. Last, select the database you want to import this dump.sql
into (you can also create a new database for the import by clicking "New...").
The import starts after clicking "Start Import" .
Terminal¶
First, create a new database as descriped in the Create Database use-case above. Then, import
the database dump dump.sql
via the mariadb
client.
mariadb -H127.0.0.1 -p3307 -uUSERNAME -pYOURPASSWORD db_name < dump.sql
Alternatively, if your database dump is compressed, import the dump.sql.gz
by piping it through gunzip
.
gunzip < dump.sql.gz | mysql -H127.0.0.1 -p3307 -uUSERNAME -pYOURPASSWORD db_name