Quantcast
Channel: MySQL – WapplerSystems
Viewing all articles
Browse latest Browse all 11

MySQL Workbench: Remove default schema at export

$
0
0

Currently it is not possible to export a database in MySQL Workbench without default schema. This is a problem if you want to import the sql file into another database.

Editing very large sql files is not even possible. For Linux the following commands may be useful. It replaces all schema names in all sql files in the current directory.

find . -name "*.sql" -print | xargs sed -i 's/NOT EXISTS `olddatabase`/NOT EXISTS `newdatabase`/g'
find . -name "*.sql" -print | xargs sed -i 's/USE `olddatabase`;/USE `newdatabase`;/g'

 


Viewing all articles
Browse latest Browse all 11