The problem: Due to a CP change we needed to swipe the server clean an set it up fresh. So I made file and db backups. When making the db backups, i was too lazy to make a single backup for every db. So i just selected all and downloaded it in a huge .sql file containing 15+ single databases. When trying to restore the databases on the freshly set up server via phpmyadmin i ran into the problem, that some databases (information schema) were allready in existence on the sql server. This resulted in an error and in an abortion of the import. So i searched for scripts and tools to split this huge db dump in the single database files it contained. All i found were some python scripts which, for whatever reason, didn´t work. I also tried to change the db in notepad which is sooooo sloooow. After almost giving up and wasting a whole fkng day, I remembered that I could just script a little program on my own. I like to share the program here (or the source code at least) to save anyone who runs in the same problem some time and headaches. This programm is scrpted in autoIT. Not very popular, but still my choice for programs like that. So feel free to use it. If someone need this as an executable, send me a pn or maybe one of the more respected members like to upload this as an exe. feel free to do so. Code: #Include <Array.au3> Global $DB_FILENAME="localhost(3).sql" ; <- Change this to the DB dump file of yours you want to split (extract) the single DBs from (Must be in the same folder as the script) Global $SPLIT_STRING="-- Datenbank" ; <- Change this to something that is right before the beginning of every DB (I use a german phpmyadmin version, in english it´s most likely -- Database). Just check your DB dump. $file=FileOpen($DB_FILENAME,128); Opens the sql file and reads it in an string in UTF-8 format. If you need it as Ansi, just delete ",128" | For more Read/Write modes see End of script $FILECONTENT=FileRead($file) FileClose($file) $File_STRING_ARRAY=StringSplit($FILECONTENT,$SPLIT_STRING,1) ;_ArrayDisplay($File_STRING_ARRAY) ; delete the first ";" in this line for debugging ; Save each DB to a single file for $i=1 to $File_STRING_ARRAY ;Get Tablename $tablename=Extract_from_string($File_STRING_ARRAY[$i],":",":","-",1) $tablename=StringRegExpReplace($tablename,"[^\w ]","") ;MsgBox("","Tablename",$tablename) $TABLECONT=StringTrimLeft($File_STRING_ARRAY[$i],StringInStr($File_STRING_ARRAY[$i],"CREATE DATABASE")-1) ;MsgBox("","Table Content",$TABLECONT) ;Save DBs to file $SAVE_FILE=FileOpen($tablename&".sql",138) ;saves the DBs in the same folder as the script in UTF-8 format | If Ansi is needed just replace 138 with 10 FileWrite($SAVE_FILE,$TABLECONT) FileClose($SAVE_FILE) Next MsgBox("","DONE","DONE") func Extract_from_string($string,$startpoint,$between_1,$between_2,$between_2_vorkommen) $start=StringInStr($string,$startpoint) if $start==0 then ;create_statusmeldun(2,"Problem extracting from sting 1: "&$startpoint,2) return "" EndIf ;MsgBox("","",$startpoint&":"&$between_1&":"&$between_2&" : "&$start) if StringInStr($string,$between_1)==0 then ;create_statusmeldun(2,"Problem extracting from sting 2: "&$between_1,2) return "" EndIf $from=StringInStr($string,$between_1,Default,1,$start) $to=StringInStr($string,$between_2,Default,$between_2_vorkommen,$from) $fromfinal=$from + StringLen($between_1) $tofinal=$to-$fromfinal $result=StringMid($string,$fromfinal,$tofinal) ;MsgBox("","lal",$from&":"&$to&" "&$to-$from) Return $result EndFunc ;[optional] Mode to open the file in. ;Can be a combination of the following: ; 0 = Read mode (default) ; 1 = Write mode (append to end of file) ; 2 = Write mode (erase previous contents) ; 8 = Create directory structure if it doesn't exist (See Remarks). ; 16 = Force binary mode (See Remarks). ; 32 = Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM. ; 64 = Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM. ; 128 = Use Unicode UTF8 (with BOM) reading and writing mode. Reading does not override existing BOM. ; 256 = Use Unicode UTF8 (without BOM) reading and writing mode. ; 16384 = When opening for reading and no BOM is present, use full file UTF8 detection. If this is not used then only the initial part of the file is checked for UTF8. ;The folder path must already exist (except using mode '8' - See Remarks).