Just do what the error message advises beginning at "
check the...." Read the MySQL docs -- probably online and easily found with a naive search for "MySQL" and "error". This is a matter of self-study and learning SQL syntax; not a Perl question.
If you fix that, the second part of the message just might go away.