• Resolved doconeill

    (@doconeill)


    I added this plugin on a pretty new pristine WordPress site (RHEL 9, PHP 8.1.27, Apache w/PHP-FPM, MySQL 8), but when I activated it and went to manage, I got the red block message, “Database table cannot be found! Reactivate or reinstall the plugin to create the table.”. Deactivating/reactivating does not help. With debug enabled, I get the following:

    WordPress database error Failed to generate invisible primary key. Auto-increment column already exists. for query CREATE TABLE wpb_quotes_llama (
    quote_id mediumint( 9 ) NOT NULL AUTO_INCREMENT,
    quote TEXT NOT NULL,
    title_name VARCHAR( 255 ),
    first_name VARCHAR( 255 ),
    last_name VARCHAR( 255 ),
    source VARCHAR( 255 ),
    img_url VARCHAR( 255 ),
    author_icon VARCHAR( 255 ),
    source_icon VARCHAR( 255 ),
    category VARCHAR( 255 ),
    UNIQUE KEY quote_id ( quote_id )
    ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; made by activate_plugin, do_action(‘activate_quotes-llama/class-quotesllama.php’), WP_Hook->do_action, WP_Hook->apply_filters, QuotesLlama->plugin_db_setup, maybe_create_table

    I don’t see anything specifically wrong, but I think the AUTO_INCREMENT might be interfering with UNIQUE KEY?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter doconeill

    (@doconeill)

    Ah…I found the problem. MySQL 8 has a “sql_generate_invisible_primary_key” parameter…Azure’s MySQL service sets this to on by default. I needed to turn it off.

    Plugin Author oooorgle

    (@oooorgle)

    Hi doconeill,

    I am going to look into that “feature” and see If I get the plugin compatible. Thanks for the info and follow-up!

    I’m running into a similar problem, with the Rate My Post plugin. Have you found a solution?

    found a solution for the problem in the other plugin, might also work for this?

    change the last line
    UNIQUE KEY quote_id ( quote_id )
    into
    PRIMARY KEY ( quote_id )

    this way sql_generate_invisible_primary_key isnt triggered, since there is an actual PRIMARY key, instead of a UNIQUE that is used as a primary.

    (because if there is no explicit primary, it will generate an invisible primary)

    • This reply was modified 5 months, 2 weeks ago by Koesper.
    Plugin Author oooorgle

    (@oooorgle)

    Hi Koesper,

    Thank you for the tip! I’ll give that a look at for sure.. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.