Different MySQL Prefix? (3 posts)

  1. AstralShane5000
    Posted 3 years ago #

    Is it even possible to use a different MySQL prefix for a plugin? Meaning, I want to use the same database along with the default wordpress tables, but create a table with a different prefix for my plugin operations.

    Is this possible? Thanks,

  2. michael.mariart
    Posted 3 years ago #

    It's possible, but you need to hard-code the prefix in when you do your programming.

    I'd also advise against doing it that way. The DB prefix is set up to signify which DB tables belogn to which system if you're uisng multiple sites/systems on a single DB. Even something like running WP and Drupal from the same DB would be the same thing. The prefix lets you know exactly which tables belong to your WP installation. This realyl helps when someone wants to delete/restore a DB for another system. They know they are safe to delete anything that doesn't use their chosen prefix... which would include all of your tables... meaning they'd delete all of the data from your plugin. It's not going to be a common use-case but the first rule of system design is that if a user can find a way to break something, they will.

  3. AstralShane5000
    Posted 3 years ago #

    Thanks. I'll stick to the WordPress prefix.

Topic Closed

This topic has been closed to new replies.

About this Topic