how to add data in a mysql table

so i was creating a menu option where user enters some data and using a function all of that data is added to a MySQL table however the data table is not being updated properly
I have checked there is nothing wrong with the table created so I think the problem lies in the code somewhere

Is there any security vulnerabilities in running a local python file with a connection string to a database?

So I’ve been scowering the web for an answer, but haven’t found one that quite satisfies my curiosity/anxiety. I’m running a python script to insert data from a collection of XL files into a database. Is there any possibility of security breaches while running the script locally? I think my hesitation is derived from having to hard code the password into the connection string. Any insights would be much appreciated!