Plesk and/or websites are inaccessible: SQLSTATE[08004] [1040] Too many connections error

Follow

Comments

4 comments

  • Avatar
    Yassir Elnaw
    The same problem under Linux Solved:
    I had the same problem in my server and found out it was due to some virus which is related to read write permission in some web-based files. the approach I took was first:
    1. Download a fresh Ubuntu latest version live cd.
    2. Make a bootable Ubuntu thumb drive.
    3. Boot your server from the live cd.
    4. Choose try Ubuntu with your internet connected.
    5. When it boots up open the terminal program & type the following command:
    sudo apt install clamav
    sudo freshclam
    Don't bother if freshclam command gives an error because your virus database might not need update.​
    6. Now you need to find a place where the root directory of your server is located. Usually it will be in /mnt directory.
    7. Now use the following command to scan the root directory of your server.
    clamscan -r --bell -i /mnt/your root directory​
    8. After scanning is done viruses will be removed & corrupted files will be repaired.
    9. Disconnect the server from the Internet and reboot it.
    10. Login to the server a sure that the main domain and the sub-domains in the /var/www/vhosts/nsxxxxxxx/ has the right read write permission and it's better to default all files to 644 and directories to 755 and it's done this way:
    cd /var/www/vhosts/nsxxxxxxxx "where xxxxxxx is the domain name"
    find . -type f -exec chmod 644 {} \;
    find . -type d -exec chmod 755 {} \;​
    11. Reboot the server and connect it to the internet
    12. Now you must be able to access Plesk normally.
    13. Now check which directory needs other read and write permission. Some might need 707 permission like image directories and some might need chown apache:apache or 
    chown www-data:www-data like cache directories in the domains and sub-domains.
    I hope this will help & thank you plesk team.
     
     
    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    Hi @Yassir Elnaw,

    As far as I understand, in your situation 'too many connections' issue was caused by some malware running on the server.

    Thanks for sharing your solution, I think it might come in handy for someone else.

    0
    Comment actions Permalink
  • Avatar
    Francois-Xavier de Crevoisier (Edited )

    Hi,

    I'm having this issue right now on my OVH VPS server.

    I tried the solutions you give on this page but it didn't work, when i try to display the current max_connections value, the same error appears :

    "ERROR 1040 (HY000): Too many connections
    exit status 1"

    what else can i try ? I'm a beginner in server administration and i'm affraid that if i restart the server while the error is still here it could lost data on restart...

     

    [EDIT] : OK, so i managed to find the my.cnf file wich was not located in the same file as indicated here. I've put a higher max-connection value and was able to reconnect my Plesk admin.

    The problem was caused by too much disk space used in my case and running : apt-get clean

    allowed me to free a little disk space and regain access to the Plesk Admin. Hope this can help some of you here.

    Warning : If you encounter the same problem as me (disk space), i highly recommend to free more disk space as soon as you get your Plesk admin access back to avoid this problem to happen again...

    0
    Comment actions Permalink
  • Avatar
    Lev Iurev

    @Francois-Xavier de Crevoisier  thanks for sharing!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request