TYPO3 7.6 LTS首次安装报错:主键重复条目'1'
I’ve helped several users troubleshoot this exact issue with TYPO3 7.6 LTS—even when using brand-new empty databases, that primary key duplicate error pops up during initial setup. Here are the most reliable fixes to resolve it:
Check and reset table auto-increment values
TYPO3 hits this error when trying to insert a record with primary key1into a table where that key is already "reserved" (even if no rows exist). Start by logging into your database and checking the status of the first table TYPO3 creates, usuallysys_file_storage:SHOW TABLE STATUS LIKE 'sys_file_storage';If the
Auto_incrementvalue is set to1but the table is empty, reset it manually:ALTER TABLE sys_file_storage AUTO_INCREMENT = 1;Then restart the TYPO3 installation wizard.
Verify database user permissions
Incomplete permissions can mess up TYPO3’s table initialization logic, leading to unexpected primary key conflicts. Make sure your database user has full privileges for the target database:GRANT ALL PRIVILEGES ON your_db_name.* TO 'your_db_user'@'localhost'; FLUSH PRIVILEGES;Replace
your_db_nameandyour_db_userwith your actual database details, then try installing again.Re-download the TYPO3 installation package
Corrupted installation files can cause broken SQL initialization scripts. Grab a fresh copy of TYPO3 7.6 LTS from the official source, extract it, and run the installation with a clean empty database.Switch to InnoDB storage engine
MyISAM can sometimes cause auto-increment inconsistencies that InnoDB avoids. Create your empty database with InnoDB as the default engine before starting the installer:CREATE DATABASE your_db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB;
Pro tip: This error almost always stems from a mismatch between TYPO3’s expected table state and the actual auto-increment value set by the database server—even empty tables can have misconfigured auto-increment counters.
内容的提问来源于stack exchange,提问作者Agata Rabb Bell

