Migration fails: Unable to add database user: Database user name is invalid

Created:

2017-06-23 08:23:47 UTC

Modified:

2017-08-16 17:05:20 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Migration fails: Unable to add database user: Database user name is invalid

Applicable to:

  • Plesk for Linux

Symptoms

By default MariaDB allows a 16-characters usernames. However, it is possible to increase the limit for the length of database usernames according to the following article:

How to increase the limit for the length of database username in MariaDB?

After that an attempt to migrate a domain with the database user which name consists of more than 16 characters fails with the following error:

Unable to create database user 'morethan16charactersdbusername' in subscription 'example.com': Command execution failed on the local server with non-zero exit code.
command: /usr/local/psa/bin/database --create-dbuser morethan16digitaldbusername -passwd '***hidden***' -domain example.com -any-database -type mysql -server localhost:3306 -ignore-nonexistent-options
exit code: 1
stdout:
stderr: Unable to add database user: Database user name is invalid.

Cause

The possibility to use long database usernames is a request with id #PPM-1889 and will be implemented in the future Plesk updates.

Resolution

As a workaround, apply the fix.

  1. Connect to the server using SSH .

  2. Download the attached archive Checker.zip and extract it:

    # wget https://support.plesk.com/hc/en-us/article_attachments/115000725194/Checker.zip
    # unzip Checker.zip
  3. Create a backup of the original Checker.php :

    # mv /usr/local/psa/admin/plib/Checker.php{,_backup}
    
  4. Place the fixed file instead of the original one:

    # mv Checker.php /usr/local/psa/admin/plib/
    
  5. In Plesk Migrator click [Re-sync] next to example.com

  6. Match Business objects and Database data and click OK :

    re-sync.png

Attachments:

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