1
vote

I've isntalled phpmyadmin via apt-get.

I've set the apache env-vars to the correct user:group. I've set ownership of /etc/apache2 and /etc/phpmyadmin to this user:group. I've restarted both apache2 and mysql several times.

My Problem: When I access [ServerIP]/phpmyadmin I get the login screen, I enter the information, and i'm right back at the login screen, with not even an error "permission denied" or "password wrong" or whatever. The only things thats different is the URL: Instead of the Original

http://[ServerIP]/phpmyadmin/index.php

I am now at

http://[ServerIP]/phpmyadmin/index.php?token=[Long Hex string here]

However, still the login dialog.

My Question: How Do I fix this?

2

15 Answers 15

2
votes

Check your cookies. I think phpmyadmin uses cookies for auth. Either you are not accepting cookies, or phpmyadmin is setting the cookie with the wrong domain

have a look at your config.inc.php file you will probably want to set the 'host' setting to the same ip as you are using to access your server.

2
  • where can I find that file? I've looked but couldn't find it anywhere.
    – TMP
    Jan 5, 2010 at 13:24
  • 1
    it should be in the same directory as phpmyadmin. It might be named config.sample.inc.php, in which case rename it. Make sure to fill out $cfg['blowfish_secret'] if you don't have a config.inc.php file already. In fact, filling in (or changing) that value might fix your problem anyway.
    – yrosen
    Jul 27, 2011 at 16:48
2
votes

I seem to have encounted this problem quite a few times in the last couple weeks.

Usually when phpMyAdmin doesn't show ANY errors while trying to use the cookie-based login its either a SESSION or POST related problem. PHP kindly omits most session errors from the log file.

Check out the following:

  • Cookies (to store session id, it should remain the same value between requests)
  • Session Directory Exists
  • Session Directory Permissions (the user should have write access)
  • Session Directory Free Space
  • Session Directory otherwise unwritable (problematic network share/drive).
  • User Disk Quota Exceeded (common if the PHP user is not www-data)
  • Other File Storage errors (such as network shares)
  • Other Session Storage errors (for instance, if you're using a special session provider)
  • max_post_size too small (or too big, 2G max_post_size rolls over to negatives)
  • Web Server Configuration problem (preventing POST requests from getting to phpMyAdmin)
1
vote

I've seen that happen if your PHP install doesn't include the "mcrypt" library. Check phpinfo() and see if you have an mcrypt section.

Do an "apt-get install php5-mcrypt" if its missing.

1
vote

I have this happen to me a couple of times per month and it is super annoying - wiping out all the cookies pertaining to PMA has always done the trick. Depending on your browser, you should be able to find some instructions here:

http://www.aboutcookies.org/Default.aspx?page=2

I have firefox and have the web developer toolbar add-on and so I simply go to Cookies->Delete Domain Cookies

1
vote

Maybe it was just that the server was briefly overloaded. Server was drawing considerable amount of resources. Try delete any unused file, example old backup data...

1
vote

I had this problem too. If you used the setup wizard to configure your instance of phpMyAdmin, make sure your config.inc.php file is in the phpMyAdmin root dir, and not still in the config directory where the setup wizard put it...

1
vote

I ran into the same issue. If you installed the mycrypt extension using apt-get php5-mycrypt you will need to manually enable it in the php.ini file.

It wasn't auto activated for me (Wasted a good hour on this).

To manually enable the extension just add

extension=mycrypt.so

to the /etc/php5/apache2/php.ini file. This can either be done anywhere in the file.

0
votes

The username and password being requested are most likely for the DB, not for anything apache related. Try a valid DB user and see if that gets you where you are trying to go.

0
votes

After installing phpmyadmin via apt-get http://127.0.0.1/phpmyadmin will work without modification and most dependencies will be satisfied. However, you may still have to install mysql:

apt-get install mysql5-server

If you want to connect to a remote mysql server you need to modify phpmyadmin's .php config file.

Another possibility is that you have cookies disabled or perhaps javascript is turned off, try using a default firefox.

0
votes

Check /etc/phpmyadmin/config.inc.php and verify all of your settings are correct.

0
votes
  1. Either mcrypt is not installed or your connection to mySQL is off
  2. To ensure you can connect to mySQL, make sure the php.ini file has the correct mySQL socket
  3. Inside php.ini, look for mysql.default_socket = /tmp/mysql.sock
  4. the mysql.default_socket should be set to the location of your installed mysql socket
  5. For mac os x 10.6. and if you installed mySQL, the default location is /tmp/mysql.sock
0
votes

I had the same issue and after going through all the PHPMyAdmin fixes nothing worked.

THEN ....

Noticed the disc was pretty full. Removed a bunch of stuff and POOF! PHPMyAdmin worked!

The full disc also prevented restarting MySQL. It stopped MySQL but it would not restart it no matter what I tried!

DISC SPACE !

1
  • Though this solved your problem I doubt that this is what's causing the OP's problems.
    – slm
    Jun 26, 2013 at 14:21
0
votes

Just had this issue. If clearing Cookies and Cache as well as editing session variables does not work for you, give this a try:

chmod 777 -R /var/lib/php5/

Giving full access to read, write, and execute to PHP5 recursively fixed my problem. Again, this problem may have to do with permissions. Ubuntu can be quite deterministic in the way you have to allow permissions. I hope this may help, and if not, at least you can check it off.

I wanted to note that another problem, although it may be totally unrelated, is that after fixing this error, another error came from it. That was of course mcrypt extension not found error. If this occurs, check out this article for an immediate fix

0
votes

There are a number of hints in other answers that mcrypt could be the culprit, but none explicitly give a solution. If you are unable to use cookie authentication, but config auth works, this may be for you. The following is based on Ubuntu 14.04 Desktop:

  1. Ensure you have php-mcrypt installed: sudo apt-get install php5-mcrypt
  2. Check the directory /etc/php5/apache2/conf.d for a symlink to mcrypt.ini (on some linux distributions, this will be just /etc/php5/conf.d).
  3. If no symlink exists, create it:

    sudo ln -s ../../mods-available/mcrypt.ini 20-mcrypt.ini

    where ../../mods-available/mcrypt.ini should be replaced with the correct relative link to mcrypt.ini (look at other symlinks in the directory for hints).

  4. Restart apache2:

    sudo service apache2 restart

0
votes

Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:

<?php
$sessionPath = 'undefined';

if (!($sessionPath = ini_get('session.save_path'))) {
    $sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();
}

if (!is_writeable($sessionPath)) {
    echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
    echo 'Session directory: "' . $sessionPath . '" is writeable';
}

If session folder is not writeable do either

sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory> -