Mysql Database Prefix

Discussion in 'Installation/Configuration' started by MostHostLA, Jan 15, 2020.

  1. MostHostLA

    MostHostLA New Member

    Maybe the latest ISP Config has changed this, but it's an issue nonetheless.
    It used to be that the client prefix during DB creation was separated by default from the username by an underscore. This seems to no longer be the case in the current distro.
    EG: I get c1whatever instead of c1_whatever

    OFC, not a big issue since you can manually type in the _, but is there a way to modify the default value?
    I don't mind digging into the PHP script, nor would I need any assistance in doing that, I'm wondering if there is an actual setting somewhere that defines this - before I go digging.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    An underscore should not be used in mysql as an underscore is a wildcard which may lead to problems that other users can login to the database, that's why it has been changed and wh you should not change the prefix back to use an underscore. Besides that, the prefixes are and have always been fully customizable in ISPConfig and ca be completely disabled as well, see System > Interface > Main config.
     
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    We've been using an underscore as well, so I'll ask a quick, "are you sure?" and prepare to update our policies/use :).

    Underscore is a wildcard in a LIKE clause, though only if it hasn't been properly escaped (prepared statement not used, etc.). I'm guessing you have run into cases in ISPConfig where this has been an issue?

    But underscore is explicitly listed as valid even when used unquoted as an identifier name (username, database name, etc.): https://mariadb.com/kb/en/identifier-names/

    Thanks...
     
    florian030 likes this.

Share This Page