Skip to content

Instantly share code, notes, and snippets.

@ramingar
Created March 15, 2022 14:04
Show Gist options
  • Save ramingar/2f33c0307e47ec3945b6470e77a602cc to your computer and use it in GitHub Desktop.
Save ramingar/2f33c0307e47ec3945b6470e77a602cc to your computer and use it in GitHub Desktop.
Import DUMPS a otra BBDD #mysql #import #continousdelivery

El script para importar los dumps es este:

#!/bin/sh

#USER=xxxxx
#PASS=xxxxx
#HOST=xxxxx

mysql  --protocol=tcp --host=${​​​HOST}​​​ --user=${​​​USER}​​​ --password=${​​​PASS}​​​ --port=3306 --default-character-set=utf8 --comments --database=db1  < "${​​​PATH_TO_DUMPS}​​​/dump-db1.sql"
mysql  --protocol=tcp --host=${​​​HOST}​​​ --user=${​​​USER}​​​ --password=${​​​PASS}​​​ --port=3306 --default-character-set=utf8 --comments --database=db2  < "${​​​PATH_TO_DUMPS}​​​/dump-db2.sql"

wait
echo "Import Dumps COMPLETE!"

NOTA: las vistas se crearán con un DEFINER incorrecto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment