Opsætning af login til phpMyAdmin.
Hvis du ønsker at login beskytte dit phpMyAdmin skal der tilføjes nogle linjer til din config.inc.php.
Flg. Skal tilføjes/ændres:
$cfg['PmaAbsoluteUri_DisableWarning'] = TRUE;
$cfg['Servers'][$i]['controluser'] = 'phpMyAdmin';
$cfg['Servers'][$i]['controlpass'] = 'blahblah';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
Brugeren "phpMyAdmin" er oprettet. Det er ikke nødvendigt, men det giver bedre sikkerhed. Den bruger kan ikke andet, end at kontrollere brugernavn og kodeord. Man kan i stedet blot bruge "root", men den skal helst bruges så lidt som overhovedet muligt.
Min config.inc.php fil ser således ud:
/**
* Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
* You should use this if and ONLY if the PmaAbsoluteUri auto-detection
* works perfectly.
*/
$cfg['PmaAbsoluteUri_DisableWarning'] = TRUE;
/**
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the relationfeatures could not be found
*/
$cfg['PmaNoRelation_DisableWarning'] = FALSE;
/**
* Server(s) configuration
*/
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = 'phpMyAdmin'; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = 'blahblah'; // access to the "mysql/user"
// and "mysql/db" tables)
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
Hvis så du vil tilføje en bruger, opretter du blot en bruger som du ville gøre på normal vis i din MySQL database.
//>Rune