pdbops
Script to automate the database import on mySql / MariaDB.
The script performs the following actions:
- backup dump (current database)
- drop (current database)
- new database creation (using the same name)
- selected database (new) dump import
Setup
- Clone the repository
- Install the package PymySQL.
- You must to be able to launch
mysql
from the command line (doc here). - Create a new config file
config.cng
from the example file. - Insert the database parameters
e.g.:
[client]
user = root
password = root
host = localhost
Import a new dump
-
In the folder
import
insert the dump files you want to import. NOTE: The file must to be in the formatfilename.sql
. -
Launch the script with:
python dbops.py
or (if you are in a unix system)
./dbops.py
and follow the instruction on the screen.