Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[HY000] [2002] Can't connect to local MySQL (oC - 5.0.10) #4395

Closed
enoch85 opened this issue Aug 12, 2013 · 6 comments
Closed

SQLSTATE[HY000] [2002] Can't connect to local MySQL (oC - 5.0.10) #4395

enoch85 opened this issue Aug 12, 2013 · 6 comments

Comments

@enoch85
Copy link
Member

enoch85 commented Aug 12, 2013

Got this message now, even after update to 5.0.10

Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 17:34
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 17:34
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 17:34
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 17:34
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 17:34
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 3:24
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 3:24
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 12.08.2013 3:24
Fatal core SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

@Niduroki
Copy link
Member

Did you make sure, that mysql is still running, by e.g. connecting manually, phpmyadmin, etc. ?

Otherwise you may try 'dbhost' => '127.0.0.1' in config.php instead of 'dbhost' => 'localhost', to not use a socket.

@kiranos
Copy link

kiranos commented Aug 12, 2013

yes this is not a owncloud bug, probably solved by the above, or might even be that the socket file is located elsewhere, you can see this with for example: "netstat -lnp" this will show your mysql socketfile location by the bottom if you have mysql installed locally.

@enoch85
Copy link
Member Author

enoch85 commented Aug 12, 2013

Ok, thanks for quick reply!

I found the socket on var/run/mysqld/mysqld.sock - now, how do I know if mysql is active? And also, how do I activate it if it´s not activated?

Thanks for your help.

@Niduroki
Copy link
Member

As @kiranos said, this is not an owncloud bug, but rather something about you setting up your server.
Closing this hence.

@enoch85
Copy link
Member Author

enoch85 commented Aug 12, 2013

After a bit of research I found out what the problem was:

My power went off due to a thunderstorm and that casued mysql and apache2 to go down by force. It seems that almost everybody with this issue have been closing down apache2 or mysql by force and that have casued corrupted files and error messages.

Is there any way to protect this from happening in the owncloud code? Like if files woulnd´t get corrupted if mysql och apache2 was forceclosed.

I rescued the old drive with a backup I had and the problem was gone.

@kiranos
Copy link

kiranos commented Aug 13, 2013

if it was killed abruptly its a good chance that the lockfile was not deleted ok even though mysql was killed. But the startup script usually take care of these conditions.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants