Sākums > Par web > ja nu nokarās mysql.sock

ja nu nokarās mysql.sock


[Good one]

Okay, so let’s answer to this question, once for all.

First of all, you DO NOT WANT to recreate mysql.sock,
that logically makes NO sense at all.

What you REALLY want to do is restart the mysql daemon (mysqld),
which when it is up and running will create a socket for you,
so you can communicate with it.

– Creating a file by hand won’t help
– Creating a socket by hand won’t help
– None of these “can talk” to the server which is “not running”.

The reason why you “lost mysql.sock” is that:
– the mysqld daemon stop or crashed
– a fatal error occurred
– your configuration is wrong /etc/my.cnf
– your permissions are wrong /var/lib/mysql and /var/lib/mysql/mysql …
=> make sure the owner is mysql:mysql and 775 or similar.
– your mysql data is corrupted: myisamcheck or mysql_install_db

Now, you may say, hey but I tried:
– /etc/init.d/mysqld restart
– /etc/init.d/mysqld start
– mysqld_safe –user=mysql &

and none of those worked…

That’s sort of normal, if the server crashed in the first place.

So, what you REALLY need to do is look at the file located in:
/var/log/mysqld.log

like this:
tail -f /var/log/mysqld.log
or
cat /var/log/mysqld.log

figure out the error message, solve that error message
or try to find a work-around for that error on google.

Once that error message is “solved”, then you can safely restart mysqld
[no need to reboot], and once the daemon is up and running,
your magical “mysql.sock” file will appear as it did before. =)

The big problem with this is that the “mysql.sock” error message
is not helping at all, and you must “know” that the real error message
is in the mysql log file that’s all.

Hope this help.

[Good one]

Original post in : http://www.linuxforums.org/forum/servers/1451-what-mysql-sock-file-2.html

  1. Vēl nav komentāru.
  1. No trackbacks yet.

Komentēt

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Mainīt )

Twitter picture

You are commenting using your Twitter account. Log Out / Mainīt )

Facebook photo

You are commenting using your Facebook account. Log Out / Mainīt )

Google+ photo

You are commenting using your Google+ account. Log Out / Mainīt )

Connecting to %s

%d bloggers like this: