Database user prefix is being shortened

Refers to:

  • Plesk 10.0.0 for Linux
  • Plesk 10.1 for Linux
  • Plesk 10.2 for Linux

Created:

2016-11-16 12:41:06 UTC

Modified:

2016-12-21 18:58:10 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Database user prefix is being shortened

Symptoms

While trying to add a database user with the prefix enabled in Database hosting settings:

For example, for a client with a long username, the prefix is addes as a truncated <panel\_username>.

Cause

This issue is caused by the MySQL default policy for database usernames - usernames must be 16 symbols or less. Therefore, in order to avoid any conflicts with MySQL database, the usernames product maintenance team has limited the length of database account names to 10 symbols if the user prefix is enabled. This leaves 6 symbols for the possible prefix, including the underscore symbol.

Workaround

Limit the username length by using the following sql query:

#  MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "insert into misc(param,val) values('db_user_length',5)"

This query above will shorten the database username length to 5 symbols, leaving 10 symbols for the database user prefix ( 16 (maximum length of database username) - 1 (for underscore symbol) - 5 =10 ).

NOTE: the input type field will allow to type in more than 5 symbols, which could lead to an issue with adding a database user which is described in KB #111389 "Error while adding database user in Plesk".

Have more questions? Submit a request
Please sign in to leave a comment.