Skip to content

Instantly share code, notes, and snippets.

@goldenbucks
goldenbucks / mysql-rename-db.sh
Created February 9, 2017 04:27 — forked from tadas-s/mysql-rename-db.sh
MySQL database rename script
#!/bin/bash
# Disclaimer - make backups, use at your own risk.
#
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
OLDDB="old_db_name"
NEWDB="new_db_name"
MYSQL="mysql -u root -pyour_password "