Skip to content

This script connects to external database server by ssh tunnel using username/password, dump database and clean import to local database

License

Notifications You must be signed in to change notification settings

aungkyawminn/mysqldb-import-bash-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Description

  • This script connects to external database server by ssh tunnel using username/password, dump database and clean import to local database
  • You will need root access to execute this script and need to pre-configure networking and security for connecting between external database server and local database server

Pre-Configure

  • You will need to enter password for user if external database server ssh service is configured using password authentication.
  • If external database server ssh service is using public key authentication, you need to add your server public key in external server's authorized_keys file.

Configuration

You need to add following information before running script.

SSH details for the external server

SSH_USER="" SSH_HOST=""

External database details

EXTERNAL_DB_NAME="" EXTERNAL_DB_USER="" EXTERNAL_DB_PASSWORD=""

Local database details

LOCAL_DB_NAME="" LOCAL_DB_USER="" LOCAL_DB_PASSWORD=""

Execute Script

# bash db_import.sh

About

This script connects to external database server by ssh tunnel using username/password, dump database and clean import to local database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages