I am working on small project where i am trying to send the pandas dataframe to mysql database.
My Dataframe contain default unnamed column which I want to send on mysql server. My sql schema contain id column with varchar(255) datatype.
create table users_sample(
id varchar(255) NOT NULL PRIMARY KEY,
#other_columns)
when i try to send the code on server i am getting the below errror
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1364, "Field 'id' doesn't have a default value")
When i serach for the solution it was suggesting that to change the datatype from varchar to int and put auto_increment constraint.
plz provide the solution.
Thanks in advance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.