using microsoft sql server i had a similar problem. i changed the way of using sqlcommand to using sql server as an external data source via odbc. the id field had to be marked as "is identity" on the sql server side, and all worked as i wanted it.
as soon as i entered a new record on the filemaker side, clicked somewhere into the layout to submit the record to the external data source, the id number that has been generated by sql server appeared on the filemaker side.
greetings from germany
ps.: when changing your file description on the mysql side, dont forget to refresh your external data source inside filemaker