• Resolved Greg Mount

    (@gregmount)


    This might be a bit obscure, but I ran into an issue trying to migrate a website between two servers. The target server is using a managed database. The migration failed and the DB logs showed the following error:

    [Warning] [MY-011071] [Server] Attempt to create or modify table without primary key: [REDACTED]_asenha_failed_logins

    I deleted the table and the issue was resolved. No issues with other tables.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bowo

    (@qriouslad)

    Thanks for reporting Greg. A couple of questions:

    1. Have you tried migrating to a regular hosting setup? If so, did you observe a similar error?
    2. What is the specification of the managed database? You maybe able to use my other plugin, System Dashboard to get some key info.

    Thanks again!

    Thread Starter Greg Mount

    (@gregmount)

    This is a DigitalOcean managed database. The error is caused because the MySQL system variable ‘sql_require_primary_key’ is set, as is the case with many managed databases. It’s possible to disable the setting, but not advisable. A better solution would be to add a sequential “entry_id” and use it as the table’s unique primary key.

    Although the table contains non-sequential data, sequential IDs can be more efficient in terms of storage and indexing. Random or non-sequential identifiers might lead to index fragmentation, which can slow down query performance in some cases.

    • This reply was modified 1 year, 2 months ago by Greg Mount.
    Plugin Author Bowo

    (@qriouslad)

    @gregmount thank you for the detailed explanation. I’ve added an ‘id’ column and set that as the primary key in the failed_logins table in ASE v5.5.1.

    Please keep the feedback coming. I love it when a root cause is identified and a fix/solution for it is clear, so I can go ahead and implement.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attempt to create or modify table without primary key’ is closed to new replies.