Cannot login to phpMyAdmin, no errors shown

2019-01-26 04:46发布

I have MySQL set up correctly on my linux computer, however I want a better way to input data into the database besides terminal. For this reason, I downloaded phpMyAdmin. However, when I try to log in to the phpMyAdmin from index.php, it doesnt do anything. It seems to just refresh the page without doing anything. I am putting in the correct MySQL username and password. What is the issue?

Here is a screen shot of what it shows after I click "go".

enter image description here

14条回答
虎瘦雄心在
2楼-- · 2019-01-26 05:24

Do you have a .htaccess file in one of the parent directories that strips off index.php from the url by doing a 301 redirect?

301 redirects discard the form data and redirect you as if you didn't submit anything. So you get returned to the login page.

So you should create a local .htaccess file in the phpmyadmin directory with a single line RewriteEngine On. This will overwrite the previous rewrite rule to nothing.

You may need to clear the browser cache as Chrome aggressively caches 301 redirects.

查看更多
SAY GOODBYE
3楼-- · 2019-01-26 05:28

I am late to the game, but on Amazon linux AMI I could not log in to phpmyadmin ... it just kept refreshing the login screen with no errors.

I have fixed with below command

sudo chmod -R 755 /var/lib/php/session
查看更多
SAY GOODBYE
4楼-- · 2019-01-26 05:30

In my case the solution was to set an Apache setting properly:

ProxyPassReverseCookiePath

This was required, because ProxyPass and ProxyPassReverse were in use, but cookie paths are not changed automatically.

It'd be great if PHPMyAdmin had shown something like session not found or anything, when password is sent with POST.

查看更多
孤傲高冷的网名
5楼-- · 2019-01-26 05:32

phpMyAdmin will show errors when login fails. If it doesn't, it means that your setup has an error.

The most likely place to check is your php.ini settings. Since there doesn't seem to be an official list of phpMyAdmin-compatible settings, it's mostly trial and error.

Make sure you have enabled the stuff that needs to be enabled. Also check that you did not enable uncommon php.ini settings (like enable_post_data_reading = Off) because phpMyAdmin assumes them to be "the usual ones".

To ease debugging, start with a clean default php.ini file then tweak them line by line to see which setting is causing the error. (Don't forget that you need to restart your server after changing the php.ini file for the changes to take place.)

查看更多
Summer. ? 凉城
6楼-- · 2019-01-26 05:34

If you have an error like:

Host 'host_name' is blocked because of many connection errors.

Login in your mysql as root and run the flush hosts command

1.- mysql -u root -p

2.- mysql > flush hosts

After this I was able to login again in phpmyadmin

查看更多
Evening l夕情丶
7楼-- · 2019-01-26 05:35

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> -

查看更多
登录 后发表回答