28

I have Ubuntu, and installed the phpMyAdmin package (currently 4:3.3.2-1). Every 30 minutes, it asks me to enter my username and password, for inactive session timeout. In earlier version of phpMyAdmin, setting a user/pass would entirely skip this login form and keep the session open indefinitely. This installation is on a dev machine (single user on closed private network) and I want to disable, or bypass that login form so I never have to actually input the user/pass again. I tried fiddling with the configuration files (there are like 3, not even sure which one is used) but nothing seems to change.

I've followed this thread : http://ubuntuforums.org/showthread.php?t=743991 which brought me to this thread http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499399 but there is no clear directive on how this be be solved.

Thanks!

Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
  • Checkout my answer at following link: http://stackoverflow.com/a/41158794/5558905 – MyO Dec 15 '16 at 07:42

5 Answers5

52

Open config.inc.php on my debian instalation i can find it at /usr/share/phpmyadmin/config.inc.php. Change auth_type and add in the first element on the array like this $cfg['Servers'][1] any data (like a host in $cfg['Servers'][1]['host']) need to auth.

EDIT:

Add this lines before first for statement in config.inc.php:

$cfg['Servers'][1]['auth_type'] = 'config';
$cfg['Servers'][1]['host'] = 'localhost'; //edit if you have db in the other host
$cfg['Servers'][1]['connect_type'] = 'tcp';
$cfg['Servers'][1]['compress'] = false;
$cfg['Servers'][1]['extension'] = 'mysql';
$cfg['Servers'][1]['user'] = 'root'; //edit this line
$cfg['Servers'][1]['password'] = ''; // edit this line
Svisstack
  • 16,203
  • 6
  • 66
  • 100
  • right, I got the config.inc.php file ... but what next? I'm not sure I'm following you; how to disable/bypass the login form or phpMyAdmin with that solution? – Yanick Rochon Jul 09 '10 at 19:59
  • 2
    Not all phpMyAdmin installations contain `config.inc.php`. Mine only contained `config.sample.inc.php`, but renaming that file and adding the lines above seemed to work. Also, you may need to change the specified `root` password. Also, you can set `extension` to `mysqli` (more secure) if your server supports it. – chrisfargen Jul 04 '13 at 08:36
  • You can simply drop the extension line, phpMyAdmin then uses mysqli per default if installed. – leemes Jul 11 '14 at 15:11
  • 2
    If you installed phpMyAdmin on Ubuntu through apt then your config will be located in `/etc/phpmyadmin/config.inc.php`. – Luke Sep 11 '14 at 06:01
25

On Ubuntu installation the config file is located at /etc/phpmyadmin/config.inc.php

Add/Correct these lines to the file:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;
matthy
  • 8,144
  • 10
  • 38
  • 47
kachar
  • 2,310
  • 30
  • 32
3

Just need to edit /etc/phpmyadmin/config.inc.php Open this file. find /* Authentication type */ add

/*costume config add by me */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;

here AllowNoPassword is responsible for allowing login without password

Abhinav bhardwaj
  • 2,657
  • 25
  • 21
2

In my case (Ubuntu 12.04, phpMyAdmin 4) I must edit same file /etc/phpmyadmin/config.inc.php

And I add:

$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'MyPassword';

AFTER

/* Authentication type */

comment (about line 107)

jmarceli
  • 19,102
  • 6
  • 69
  • 67
0

As an addition to kachar and matthy's answer if you have have phpmyadmin/config.sample.inc.php instead of phpmyadmin/config.inc.php please rename the sample file. It solves in my case and detected as config file.

mcanvar
  • 465
  • 6
  • 13