This fixes 8173, if target was not defined it would break, now it wont
Merge pull request #8191 from Jmainguy/mysql_db_8173

This fixes 8173, if target was not defined it would break, now it wont