Articles in this section

Unable to access phpMyAdmin in Plesk: Failed to store CSRF token in session! Probably sessions are not working properly

kb: technical Plesk Obsidian for Linux

Applicable to:

  • Plesk for Linux

Symptoms

  • When accessing phpMyAdmin from Plesk, it fails to load with the message:

    PLESK_INFO: Failed to store CSRF token in session! Probably sessions are not working properly

  • File /usr/local/psa/phpMyAdmin/config.plesk.php does not exist on the server:

    # ls -l /usr/local/psa/phpMyAdmin/config.plesk.php
    ls: cannot access /usr/local/psa/phpMyAdmin/config.plesk.php: No such file or directory

  • Information about failed phpMyAdmin update is logged in /var/log/plesk/install/autoinstaller3.log:

    CONFIG_TEXT: rpm scriptlet: ***** upgrade problem report *****
    rpm scriptlet: ERROR while trying to execute SQL query, the query was: RENAME TABLE phpmyadmin_PiPsuNrJhtKG.pma_bookmark TO phpmyadmin.pma__bookmark

Cause

phpMyAdmin installation was corrupted during the Plesk/system update.

Resolution

Reinstall phpMyAdmin:

  1. Connect to the Plesk server via SSH.

  2. Check if the phpmyadmin database exists on the server:

    # plesk db "show databases like '%phpmy%'"
    +--------------------+
    | Database (%phpmy%) |
    +--------------------+
    | phpmyadmin         |
    +--------------------+

    Note: Databases with the names like phpmyadmin_XXXXXXXXXXXX are likely to be the customers' databases. Do not remove them.

    If it is, create a backup of this database:

    # plesk db dump phpmyadmin > /root/phpmyadmin.sql

  3. Remove this database from MySQL:

    # plesk db "drop database phpmyadmin"

  4. Check if the phpmyadmin user exists in the mysql.user table:

    # plesk db "select User from mysql.user where User like '%phpmy%'"
    +------------------+
    | User       |
    +------------------+
    | phpmyadmin |
    +------------------+

    If it is, create a backup of the MySQL database:

    # plesk db dump mysql > /root/mysql`date +%F_%H.%M`.sql

    And remove this user:

    # plesk db "DROP USER 'phpmyadmin'@'localhost'"

  5. Restart MariaDB/MySQL:

    # systemctl restart mariadb

  6. Remove the phpMyAdmin package:

    • on CentOS/RHEL-based distributions:

      # rpm -e --nodeps psa-phpmyadmin

    • on Debian/Ubuntu-based distributions:

      # dpkg -r --force-depends psa-phpmyadmin

  7. Install phpMyAdmin back:

    # plesk installer update

  8. Access phpMyAdmin. If it fails to load with the same error message, clear browser cache.

 

 

Was this article helpful?

Comments

1 comment
Date Votes
  • I did this, twice. cleared cookies, cache, 2 different browsers - always the same. this happened after i upgraded from 18.0.64 to 18.0.65 and I cannot access my client databases anymore - they are running, the sites are up and working, but I can't get to them!

    0

Please sign in to leave a comment.