diff --git a/autotest.sh b/autotest.sh
index 094f50d4370d1dcd5d32ad5dc886add60e4d47a0..8edb5f3915a9f1ce09fc82bfab5636c9180fe935 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -163,7 +163,7 @@ function execute_tests {
 
 	# drop database
 	if [ "$1" == "mysql" ] ; then
-		mysql -u $DATABASEUSER -powncloud -e "DROP DATABASE $DATABASENAME" || true
+		mysql -u $DATABASEUSER -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" || true
 	fi
 	if [ "$1" == "pgsql" ] ; then
 		dropdb -U $DATABASEUSER $DATABASENAME || true