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

Follow

Comments

9 comments

  • Avatar
    Anton Maslov

    D Koop we were able to reproduce the issue on the MariDB where its schema was not upgraded. Please try to execute the below command and then try to create database user from Plesk UI with a name >16 symbols:

    MYSQL_PWD=$(cat /etc/psa/.psa.shadow) mysql_upgrade -uadmin

    0
    Comment actions Permalink
  • Avatar
    D Koop
    • CentOS 7
    • Plesk 18.0.20
    • mysqld Ver 10.2.27-MariaDB-cll-lve

     

    0
    Comment actions Permalink
  • Avatar
    D Koop (Edited )

    Hi Anton. I have the following error and that is why I got here. I have fixed this by shortening the username on the old server. The username was 18 characters long. The source server is cPanel.

     Unable to create database user 'verylongname' in subscription 'somedomain.com': Command execution failed on the local server with non-zero exit code.
    command: /usr/local/psa/bin/database --create-dbuser verylongname -passwd '' -domain somedomain.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.
    0
    Comment actions Permalink
  • Avatar
    Alexandr Nikolaenko

    Hello,
    Yes, please try with "--force".

    0
    Comment actions Permalink
  • Avatar
    D Koop

    It looks like this fix does not work on the latest version anymore. When running a migration, the following command is shown with an error. When I executed this on command line, it fixed the issue. However, I still can not import long mysql names.

    /usr/local/psa/bin/secret_key --list
    PHP Fatal error: Declaration of Checker::sys_login($login, ?Db_Table_Row_ServiceNode $serviceNode = NULL) must be compatible with AbstractChecker::sys_login(string $login, ?Db_Table_Row_ServiceNode $serviceNode = NULL): bool in /usr/local/psa/admin/plib/Checker.php on line 7
    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    Hello,

    You seem using Plesk Obsidian 18.0. That hotfix is not needed on Obsidian, it has new limits introduced already with 32 symbols for a database user name.

    0
    Comment actions Permalink
  • Avatar
    D Koop

    Hi Anton,

     

    Thanks for your effort. However, this is the result. Note that I use it in combination with CloudLinux. Their upgrade system should have run the upgrade already. Should I use the --force flag?

     

    This installation of MySQL is already upgraded to 10.2.27-MariaDB, use --force if you still need to run mysql_upgrade

     

    Daniel

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    Hello,

    I was able to get the same result, we will double check internally and update article here accordingly.

    0
    Comment actions Permalink
  • Avatar
    Bulat Tsydenov (Edited )

    @D Koop and @erdinckoc

    Hi, What Plesk and OS version are you running? What version of MySQL or MariaDB is installed on your servers?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request