'Is all auto increment must be primary key? If yes how to I change all primary keys with auto_increment in imported database in mysql?

When I import SQL file into a database that has 1GB. I have tried

shell_exce('mysql -uusername -ppassword database_name < sqlfiel.sql')

But it was not set primary keys as auto_increment. So that I have

"Duplicate entry '0' for key 'PRIMARY'

This error when I insert data into DB.

How to set need primary key column as auto_increment?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source