A shared phpMyAdmin endpoint should let each database user authenticate with an individual MySQL or MariaDB account instead of relying on credentials stored in the web application's configuration. Cookie authentication provides that login boundary while leaving database authorization to the server.
In cookie mode, phpMyAdmin encrypts the submitted password in a temporary browser cookie and uses it for the selected server entry. The entry's user and password values remain empty, while a persistent 32-byte blowfish_secret lets phpMyAdmin decrypt the cookie across requests.
Serve the login page over HTTPS, keep AllowNoPassword disabled, and use a non-root database account with only the required schema privileges. Cookie encryption protects browser storage, not an HTTP login request in transit.
$ sudo install -d -m 0700 -o root -g root /var/backups/phpmyadmin
$ sudo install -m 0600 -o root -g root /path/to/config.inc.php /var/backups/phpmyadmin/config.inc.php.before-cookie-auth
An invalid PHP statement or server index can block every phpMyAdmin login. /path/to/config.inc.php represents the active file located in the first step, and /var/backups/phpmyadmin stays outside the phpMyAdmin application tree and every served document root.
$ php -r 'echo bin2hex(random_bytes(32)), PHP_EOL;'
The 64-character output is a credential and must not be reused from documentation, command transcripts, or another installation.
$ sudoedit /path/to/config.inc.php
$cfg['blowfish_secret'] = sodium_hex2bin('<64-character-hex-value>');
The placeholder represents the hexadecimal value generated in the previous step, and the conversion must resolve to exactly 32 bytes.
$cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = ''; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['AllowNoPassword'] = false;
The entry's existing host, port, and TLS settings remain in place. MySQL or MariaDB still controls which account hosts and database privileges are accepted.
$ php -l /etc/phpmyadmin/config.user.inc.php No syntax errors detected in /etc/phpmyadmin/config.user.inc.php
The official Docker image loads /etc/phpmyadmin/config.user.inc.php after its generated configuration. For package or source installations, the command path is the active file located in the first step.
https://pma.example.net/






The navigation should show only databases granted to the signed-in account. An access-denied message for the valid password points to the database account's host match, password, or privileges rather than the cookie-mode directive.