Last active
October 31, 2019 22:00
-
-
Save DAVIDhaker/c5496e9063d5c42fe083561668e22414 to your computer and use it in GitHub Desktop.
Snippet for HeidiSQL (and other DB managers)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- BE ATTENTIVE BEFORE USE! | |
SELECT DATABASE() INTO @db; | |
DO | |
@qdrop := CONCAT("DROP DATABASE `", @db, "`"), | |
@qcreate := CONCAT("CREATE DATABASE `", @db, "` /*!40100 COLLATE 'utf8mb4_general_ci' */"); | |
PREPARE stmt FROM @qdrop; | |
EXECUTE stmt; | |
PREPARE stmt FROM @qcreate; | |
EXECUTE stmt; | |
USE @db; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment