Articles in this section

MariaDB upgrade fails: The user specified as a definer ('mariadb.sys'@'localhost') does not exist

Plesk for Linux Plesk Obsidian for Linux Plesk Obsidian

Symptoms

  • Upgrade MySQL databases fail with the following error:

    # MYSQL_PWD=cat /etc/psa/.psa.shadow mysql_upgrade -uadmin
    Phase 3/7: Fixing views
    mysql.user
    Error : The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    error : Corrupt
    Phase 4/7: Running 'mysql_fix_privilege_tables'
    ERROR 1449 (HY000) at line 8: The user specified as a definer ('mariadb.sys'@'localhost') does not exist

  • mariadb.sys user does not exist:

    # plesk db "select host,user from mysql.user where user='mariadb.sys';"
    #

Cause

The user mariadb.sys no longer exists, but is specified as a definer.

Resolution

  1. Connect to the server via SSH

  2. Rename the user.frm file:

    # mv /var/lib/mysql/mysql/user.frm{,.bak}

  3. Restart the MariaDB service:

    # systemctl restart mariadb

  4. Upgrade the MySQL databases to recreate the user table:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin --force

Note: In case the warning "This installation of MariaDB is already upgraded" is displayed, run the command with the option --force.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.