Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 17 lines (12 sloc) 463 Bytes
#!/bin/bash
DBUSER=root
DBPASSWORD=qazwsxedc
DBSNAME=apocalypticdates # source DB
DBNAME=apocalypticdates_test # destination DB
DBSERVER=127.0.0.1
echo "Copying DB structure..."
DBCONN="-h ${DBSERVER} -u ${DBUSER} --password=${DBPASSWORD}"
echo "DROP DATABASE IF EXISTS ${DBNAME}" | mysql ${DBCONN}
echo "CREATE DATABASE ${DBNAME}" | mysql ${DBCONN}
mysqldump -d ${DBCONN} ${DBSNAME} | sed 's/ AUTO_INCREMENT=[0-9]*\b//' | mysql ${DBCONN} ${DBNAME}
echo "Ok"