13

I have phpMyAdmin on a remote server. It was fine until today, I used it many times (so the username and password are fine). However, today the whole site did not worked, it simply said "too many connections".

First I retried to restart Apache and MySQL, and it didn't fixed the problem.

Then I rebooted it with shutdown -r now, and the main site does work now, but phpMyAdmin still won't log in (and it does not show any error). After typing my user and password and hitting enter, it shows the exact page (with no error) as nothing would have happened. I can see that the token is different in the Address bar though.

I tried removing all php sessions manually from /tmp folder (by ftp), and it has the same problem. Could the database of phpMyAdmin itself be corrupt? How can I fix this?

Thanks in advance

nastaseion
  • 173
  • 1
  • 2
  • 9
  • try to connect from another computer. Also try to connect to mySQL without phpmyadmin. Also try to make sure php is displaying the errors (server on production environment). That might give you a few more clues – aleation Feb 20 '14 at 09:42
  • Also see http://stackoverflow.com/a/28673074/632951 – Pacerier Feb 23 '15 at 11:47

15 Answers15

28

My issue was, I was using HTTP instead of HTTPS. I don't know why, my server allows both connections, but I must have made a change some where so it only allows HTTPS connections. Once I switched over, the website started to work again.

Caperneoignis
  • 1,353
  • 13
  • 16
  • 5
    I spent the better part of a day searching logs and just looking for a reason why I couldn't connect. I put https in the front and boom... Thank you – Jeremey Jul 28 '16 at 04:48
  • @Jeremey glad I'm not the only one who had that problem. Glad my fix helped you out. – Caperneoignis Jul 28 '16 at 11:14
  • 1
    It appears that after the **first time I logged on using https** with a self-signed certificate, from then on I could not log on with http. – Bob Stein May 24 '18 at 13:59
  • 1
    This happened to me only after i used ssh port forwarding to access another phpmyadmin, before that phpmyadmin was okay with plain http. – Nabil Ali May 31 '18 at 16:03
23

In my case, the hard drive on the server was full.

In Linux, use df -h to view the available space on the hard drive and clean up unnecessary files.

Michiel Pater
  • 22,377
  • 5
  • 43
  • 57
9

I just spend forever troubleshooting this.

You are missing the mcrypt extension.

The mcrypt extension is missing. Please check your PHP configuration

You can check if this is the case by forcing

$cfg['Servers'][$i]['auth_type'] = 'http';

and looking at errors when you login.

Community
  • 1
  • 1
Jeff T
  • 620
  • 8
  • 12
  • 1
    I had mcrypt but an unsupported MySQL version. Changing to http auth to get the error message saved me tons of time. Thank you sir. – user1974458 Feb 28 '15 at 04:38
  • I have mcrypt installed and enabled. I tried changing the auth_type to HTTP, but only had the same effect: login window reappears immediately without any error message. – Teekin Feb 27 '17 at 19:38
  • This finally worked for me after all the other solutions failed. – David Okwii Oct 13 '17 at 07:23
  • Thats the best answer I guess. My error was also unrelated to session and mcrypt. Thank you for this answer! – Shirker Jul 09 '18 at 08:13
6

Possibly no space left on the device. In many cases it will not allow to create the session due to lack of space for the file.

Bartosz Pachołek
  • 1,278
  • 1
  • 8
  • 17
4

Possible reasons are-

a) user has been locked.

b) There are too many users more than specified.

c) Your System/Ip (rights were provided to which) has been changed.

Please follow below steps-

Step1: Please server connect with root user and check if you are able to use your DB.

Step2: execute below commands.

mysql> flush hosts;

Now try to connect from phpmyadmin if success then fine other wise check if you are getting any IP related error if yes then check if that ip have required permissions.

Other Reasons may be

  1. opened_files_limit crossed whatever you mentioned in your configuration file.
  2. disk full.
  3. too many thread opened/too many connections.
  4. your login_user has been locked due to wrong password input a certain times (limit mentioned in configuration file default is 10).
  5. mysql port (default is 3306) is not open on DB server from outside.
  6. user does not have permissions from your system IP. etc.
Zafar Malik
  • 6,734
  • 2
  • 19
  • 30
  • Ok, so it's my VPS, so I am the only user. I can login as root with putty. But I don't think there is any reason to flush the hosts, here is from mysql docs: "You should flush the host cache if some of your hosts change IP address " - which did not happen – nastaseion Feb 20 '14 at 09:58
  • There can be another reason also for account lock suppose you tried wrong password more than limit specified in config file.... – Zafar Malik Feb 20 '14 at 10:04
  • I noticed that the problem is bigger than that. No text files are updated on the whole server (no logs are added to .txt files, no php sessions are saved, etc) - all new files that are created have 0 bytes – nastaseion Feb 20 '14 at 11:42
  • Go to your data directory and check if mysql has proper ownership on directory and table files etc. – Zafar Malik Feb 20 '14 at 12:13
  • Ok, fixed the issue. The main user on the server had a quota of 1024K (soft kilobytes and hard kilobytes). I have set that to unlimited and now everything works properly. – nastaseion Feb 20 '14 at 13:11
  • 1
    Is there really no generic way to get phpMyAdmin to say something about what went wrong? The list of things that MIGHT be wrong is virtually endless, and will continue to grow as various packages change as time passes. – Teekin Feb 27 '17 at 19:22
3

In my case, it was that I was trying to access through HTTP, not HTTPS.

Once I changed the address to https://mysite/phpmyadmin I was able to access.

Amir Khalil
  • 187
  • 2
  • 14
  • Why i don' understand but it worked me ))), thank. the reason is HTTPS – Clever Dec 17 '19 at 21:51
  • My guess is somewhere in the phpmyadmin configuration they're restricting access without SSL connection. Not sure where exactly is this setup. – Amir Khalil Dec 17 '19 at 22:01
3

I had similar problems with login. I solved it by clearing browsing data in Chrome. Maybe just simple restarting Chrome would be enough. I noticed that I was able to login in incognito mode even without clearing browsing data or restarting Chrome. Interesting when I was trying clearing cookies for site manually it didn't solve the problem.

quicklikerabbit
  • 3,257
  • 6
  • 26
  • 39
Ecko
  • 31
  • 2
2

Check if there is enough space available on server. In my case it was space problem. I deleted some files and its working fine now.

To check available space : df -h

To check available inodes : df -i

CodeIgniter cache was taking so much space.

Max
  • 1,528
  • 21
  • 33
1

If there are multiple MYSQL connection running simultaneously, PHPMYADMIN won't allow you to login (neither it'll show any error).

Either you need to increase your max_user_connection value (you can do that via ini) or you need to wait for sometime and try.

Munjal Mayank
  • 131
  • 1
  • 10
  • Usually in this case, a user sees the "too many connections" error. Can you reliably reproduce that the error message isn't displayed when max_user_connection is exceeded? Also, technically it's MySQL that won't allow the login, not phpMyAdmin, which only can do what MySQL allows it to :) – Isaac Bennetch Feb 21 '14 at 13:32
1

Had the same issue.

I made a typo in my php.ini file (letter 'B' at the end of 2GB is the error):

post_max_size = 2GB
upload_max_filesize = 2GB

Apache started up but the php.ini file didn't load correctly. After fixing the typos and reloading Apache every thing worked ok.

Caperneoignis
  • 1,353
  • 13
  • 16
userlond
  • 3,632
  • 2
  • 36
  • 53
0

Another reason not mentioned so far:

Modifying the webserver headers such as X-Frame-Options and others can have an effect on loading any page post-login. After login, you may see the login page refresh, but notice the address bar shows index.php+hash (meaning you are actually logged in). Or, you may simply get a blank page.

Use a browser inspector to check your PMA login page for headers received - if you see something, check your webserver configuration files for header modifications. In my case X-Frame-Options was set along with others. Once I commented these out, PMA was fine..

B. Shea
  • 829
  • 14
  • 29
0

sudo htpasswd /etc/phpmyadmin/htpasswd.setup admin

Simpler
  • 1,317
  • 2
  • 16
  • 31
0

a redirect can cause error. for example this lines in .htaccess in root folder :

# redirect all index.php to the folder root
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]

to solve it , you can simply create a .htaccess in PMA directory and put this line in it :

RewriteEngine Off
Ehsan Chavoshi
  • 681
  • 6
  • 10
0

My issue was a hard coded host ip in the config file:

$cfg['Servers'][$i]['host']

Since my host IP has changed, I started having the issue.

Hope this helps someone else.

GTodorov
  • 1,993
  • 21
  • 24
-1

This is just a work around but it works for me. When trying to connect to phpMyAdmin use the local host IP address instead of the word 'localhost'.

For example type '127.0.0.1/phpMyAdmin'

N.Cote
  • 1