MySQL 1062 – Duplicate entry ‘0’ for key ‘PRIMARY’

You need to specify the primary key as auto-increment CREATE TABLE `momento_distribution` ( `momento_id` INT(11) NOT NULL AUTO_INCREMENT, `momento_idmember` INT(11) NOT NULL, `created_at` DATETIME DEFAULT NULL, `updated_at` DATETIME DEFAULT NULL, `unread` TINYINT(1) DEFAULT ‘1’, `accepted` VARCHAR(10) NOT NULL DEFAULT ‘pending’, `ext_member` VARCHAR(255) DEFAULT NULL, PRIMARY KEY (`momento_id`, `momento_idmember`), KEY `momento_distribution_FI_2` (`momento_idmember`), KEY `accepted` (`accepted`, `ext_member`) … Read more

Are table names in MySQL case sensitive?

In general: Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory. Consequently, the case sensitivity of the underlying operating system plays … Read more

tech