MySQL database and username regex does not allow dot

Discussion in 'Developers' Forum' started by choong, Feb 3, 2018.

  1. choong

    choong New Member

    I would like to be able to create database users and databases containing a dot. This is allowed by MySQL, but ISPConfig's regex does not allow it:
    # database_user.tform.php:
    'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
    # database.tform.php:
    'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
    @till I could send a patch to add the "." to the regex. Or I could send a patch to make the regex configurable. What do you think?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It is a good practice to not use dots in MySQL identifiers, older MySQL versions don't support it and in newer versions, you will get in trouble when someone or the software that uses the MySQL database does not quote the identifier correctly. That's why we decided to not allow dots in identifiers in MySQL. You are free to patch that in your own ISPConfig copy, but we will not add that patch to the upstream build.
  3. choong

    choong New Member

    @till Roger, thanks for your response.

Share This Page