The file name must be enclosed into single quotes, as required by the syntax of the LOAD DATA FILE
command.
Hence you could try something like (untested):
for file in files
do
source=$file
gunzip $source
source1=${file%*.*} #remove the gz extension
#connect to database
mysql --host=localhost --user=user --password=password mydb << EOF
LOAD DATA LOCAL INFILE '$source1' INTO TABLE mytable;
EOF
done