whats meaning of "Error establishing a database connection" - php

i have one wordpress blog name as
http://shareprogrammingtips.com/
its hosted on hostgator and works fine. But suddendly i am getting error like
Database Error:
Error establishing a database connection
when i open my blog.
i have not done anything with php my admin of my webspace. i havent touch any setting still i am getting this.
why this error comes and how can i remove that ?

Chances are there is an issue with one of the following:
The database server is down (try connecting via a MySQL client such as PHPMyAdmin or the MySQL admin tools http://dev.mysql.com/downloads/gui-tools/5.0.html)
Incorrect username/password
Your username/password is correct however you don't have permission to connect from your current hostname (e.g. database only allows local connections).
You specified a database table that does not exist.

If you have't changed anything in the site wp-config.php or in Wordpress at all, it's probably nothing more than a temporary glitch at your webhost. Open a ticket with them.

Hostgator places a limit that database can consume only 25% of total memory assigned to a hosting account. You have mysql server going away that crashed your server.Kind of "Memory Issues" if it is repeatedly occuring the hostgator support will finally ask you to upgrade

Related

Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server

Note: Enabling the database statistics here might cause heavy traffic
between the web server and the MySQL server.
I got this error when I tried to add a new database in BlueHost phpMyAdmin. How can I solve this issue?
First go on your Cpanel
dont open PhpMyadmin
Click on
MySQL® Databases
There Create New Database then Open Phpmyadmin
where your database present
THANKS

Database connection error (2): Could not connect to MySQL

I am getting this error on my Joomla site.
Please note:
I have checked configuration file and there is no error in it.
I get this error few times a day. Without making any change it gets connected and some time this error appears.
Can someone please help in this.
Thanks
Dani
This happens when the MySQL server is overloaded, and so it stops responding. If you are on a shared hosting, then you should ask to be moved to a less crowded server. If you are on a VPS (with a fair use policy) or on a dedicated server, then you should enable and check the slow query log for the slow queries causing your MySQL server to crash.

Wordpress "Connection lost. Saving has been disabled" Error only when posting to Amazon EC2

This is happening everytime I try to write/submit new post to my wordpress site hosted on Amazon EC2 micro instance.
Error I get "Connection lost. Saving has been disabled until you’re reconnected. We’re backing up this post in your browser, just in case."
I started getting this error when I upgraded to Wordpress 4.0, as suggested on stackoverflow I downgraded to 3.9, it went fine for a month but again this problem has resurfaced.
I get connection lost and it is always followed by
"Error establishing a database connection"
My local host works absolutely fine(with exactly same site), never giving an error. It has to do something about Wordpress + Amazon.
I don't think it has to do anything with the Swap Memory or anything like that because I can easily make a post using Microsoft Word. Plus my site is fairly new with just 2 to 5 users at a time.
Please help me, this is annoying. I have to restart the server every time to get rid of this.
To be able to diagnose your problem, we would need more details
Where is running your database ? Is it on the same EC2 instance, another one or RDS ? What instance type are you using ?
A likely cause is a database memory problem. On t2.micro instances, there is not enough memory to keep the OS, the database and the web server running at the same time.
You'll have to create a swap file and add it to the OS (see "Stopping MSQL from crashing" in https://gist.github.com/rozeykex/7882972)

'Database Error: Unable to connect to the database:Could not connect to MySQL' in Joomla

I am using joomla 1.5, and my site was running fine, but suddenly couple of days back I got the error Database Error: Unable to connect to the database:Could not connect to MySQL
Its not always, the error is coming. Sometimes the error is coming, and sometimes not. If I have wrong database connection values, then why, is the site coming perfect sometimes. I double checked my database connection values, and are completely fine.
Try http://www.scholarsmarket.com/beta/top-ranked-students this link. Refresh this couple of times. You will get the problem
I am stuck with this error. Can't get out of this.
It a very common issue to tell exact reason, I think you should start from asking your hosting support about any limitations e.g. Database connections?
then take a look at the logs and statistics - probably you site suddenly got too much visitors at that time?
If this error seems to pop up 'randomly' it's usually because either persistent connections are used (or another reason why the connection goes into sleep mode for some time). Persistent connections are generally not a good idea on medium- to high-traffic sites, since it clogs up your database with 'sleeping' connections. Once those connections hit the maximum connection account for your database user, the MySQL server will reject any new connections and throw the error you are seeing.
So, in order to fix this problem, make sure your db config is not set to use persistent connections. You can also verify if this is the problem by running this query on your database (given that you have the proper permissions to do so):
SHOW PROCESSLIST;

mysql_connect returning "Can't connect to local MySQL server through socket" on remote host connection?

I have a server that's returning an unexpected, intermittent error and wondering if anyone has either experienced it before or can guess what might be going on. My search has so far has been unfruitful.
Im connecting to a remote mysql server using mysql_connect() in the usual way, but for the last 2 weeks (couple of times a day) the connection to the database fails and I get an unable to connect to socket error?
Error: 2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Obviously this is unexpected as Im trying to connect to a remote host. Does mysql_connect default to localhost if the remote host is unavailable? I've not known it to do that, and nothing in the docs that say it does.
There doesn't seem to be any pattern to the failed connections, various files and it happens at all sorts of time of day. Im thinking it might be network traffic related, because if you refresh the page straight away it connects fine, but am confused as to why Im getting an unable to connect to socket error.
the database provider has checked and are unable to find an issue with the server itself.
anyone have any ideas?
Im sure it doesnt default to localhost, and im also pretty sure that it is the remote server sending you the error message. So it's "Local" on your mysql server, not local on "your" server.
In this case its probably due to downtime on the remote server.
Gr.
ok, facepalm moment... after this hitting me for ages I finally found why mysql_error() was reporting the socket error. in my code there was a mysql_select_db() that I didnt notice and it was that, thats reporting the socket error as there is no open connection for it to use.
actual error the mysql_connect is reporting is (2003) Can't connect to MySQL server on 'mysql.hostname.tld'. Im still leaning towards some sort of DNS lookup/network traffic issue, Im currently using the IP address to connect to see if that errors.
But as far as this question is concerned, the answer is "Im a numpty".
Have a look at this
Had a similar thing a while back.
Are you connecting from home? The reason I ask is that my ISP likes to mess around re-assinging IP addresses to my home account, and I have an IP authorization on my remote MySQL.
I think I opened up the IP connnection limitation thing to a string that was IP Addresses for my region and that solved the problem.
If you're running Windows, there might be too many connections already, if so go to http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html#can-not-connect-to-server-on-windows and have a read.
Else, perhaps someone someone may have removed the Unix socket file that mysqld uses (/tmp/mysql.sock by default). For example, you might have a cron job that removes old files from the /tmp directory.

Categories