Import lots of mysqldumps with missing CREATE DATABASE I have a bunch of mysqldumps of my old server with one database each.

Unfortunately we forgot to add 

CREATE DATABASE ...


in all those dumps.

How can I import those files in one batch?
This script creates all databases accordingly to the names of the files:

PW=your password here
for i in *.sql; do db=$(echo $i|sed s/.sql$//;); 
  echo $db ...; 
  mysql -u root -p$PW -e "create database $db"; 
  mysql $db -u root -p$PW &lt; $i; 
done