You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TYPO3 7.6 LTS首次安装报错:主键重复条目'1'

Fixing "Duplicate entry '1' for key 'PRIMARY'" in TYPO3 7.6 LTS Fresh Installation

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 key 1 into 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, usually sys_file_storage:

    SHOW TABLE STATUS LIKE 'sys_file_storage';
    

    If the Auto_increment value is set to 1 but 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_name and your_db_user with 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:23:44