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>.
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.
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".