The parameter marker is %s not %d.
add_user = """INSERT INTO DB.tbluser
(username, department, startyear, currentpos, link)
VALUES (%s, %s, %s, %s, %s)"""
Note that the parameter markers used by mysql.connector may seem to be the same like the %s used in the Python string formatting however the relationship is only coincidental. Some database adapters like oursql and sqlite3 use the ? as the parameter marker instead of the %s.
Want to be a SQL expert? Join this SQL Certification course by Intellipaat.
You can check out the below MySQL Tutorial video for better understanding.
For more information, kindly refer to our Python course.