Skip to content

Instantly share code, notes, and snippets.

View murich's full-sized avatar

Andrii Murashkin murich

View GitHub Profile
@christopher-hopper
christopher-hopper / clone-mysql-db.sh
Last active January 15, 2021 17:16
Clone a MySQL database to a new database on the same server without using a dump file. This is much faster than using mysqldump.
#!/bin/bash
DBUSER="root";
DBPASS="";
DBHOST="localhost";
DB_OLD=mydatabase
DB_NEW=clone_mydatabase
DBCONN="--host=${DBHOST} --user=${DBUSER} --password=${DBPASS}";