Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
where can i find the mysql.sock file or how do i make one...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314

    what is the mysql.sock file


    where can i find the mysql.sock file or how do i make one

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    The mysql.sock is the socket that mysqld creates for programs to connect to. I think it usually is /var/lib/mysql/mysql.sock. At least it is on my system. mysqld automatically creates it upon startup.

  3. #3
    Just Joined!
    Join Date
    May 2003
    Location
    /var/www/
    Posts
    23
    Quote Originally Posted by Dolda2000
    mysqld automatically creates it upon startup.
    Sorta off-topic, but what the hell...

    I had just updated my RedHat 8.0 system with the latest patch, when my MySQL database stopped working. I looked in /var/lib/mysql, and I couldn't find the mysql.sock file. I got kinda stressed, thinking that my databased were f*cked up, but then I rebooted and the .sock file were replaced.

    Have no idea, guess it had something to do with the MySQL getting updated or something...

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You didn't just try "service mysqld restart"? You know, an advantage of Linux/UNIX is that unless you're doing kernel upgrades, you never need to reboot.

  5. #5
    Just Joined!
    Join Date
    May 2003
    Location
    /var/www/
    Posts
    23
    Quote Originally Posted by Dolda2000
    You didn't just try "service mysqld restart"?
    Thanks for the tip, I'm still learning!

  6. #6
    Just Joined!
    Join Date
    Mar 2005
    Location
    mexico
    Posts
    1

    Solution to lost mysql.sock file

    Only delete de log files ib_logfile0, ib_logfile1 and ibdata1 in the /var/lib/mysql directory and then type:

    "mysqld_safe --user=mysql &"

    and automatically the mysql.sock file will be create and the news logs files.

  7. #7
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512

    Re: Solution to lost mysql.sock file

    Quote Originally Posted by moradoxy
    Only delete de log files ib_logfile0, ib_logfile1 and ibdata1 in the /var/lib/mysql directory and then type:

    "mysqld_safe --user=mysql &"

    and automatically the mysql.sock file will be create and the news logs files.
    Wow!!! Do not this if you are using InnoDB as db. Then you'll loose a lot of information. Deleting those files that is.

  8. #8
    Just Joined!
    Join Date
    Nov 2005
    Posts
    1

    How to recreate mysqld.pid & mysqld.sock

    Hi,

    Somehow the mysqld.pid (/var/run/) & mysqld.sock (/tmp/) files got deleted deleted. Consequently, mysql is not getting started. I'm finding it difficult to restore the files.

    Require your urgent attention.

    Thanks in advance

    --
    Nabonita

  9. #9
    Linux Newbie beachboy's Avatar
    Join Date
    Apr 2005
    Location
    Rockford, MI 49341
    Posts
    125
    Quote Originally Posted by Dolda2000
    You know, an advantage of Linux/UNIX is that unless you're doing kernel upgrades, you never need to reboot.
    That is the best reason for anybody to get away from Microsoft Windows! Very well said Dolda2000.
    <advertising NOT allowed in signatures>

  10. #10
    ox
    ox is offline
    Just Joined!
    Join Date
    Jan 2005
    Location
    Oregon
    Posts
    2
    I am in the exact same fix. I upgraded to mysql 5.1 and haven't been able to restart the server. I do not have a mysql.sock file and I am unable to generate on. The server fails with this error at boot up.
    Code:
    Starting MySQLCouldn't find MySQL manager or server        &#91;FAILED&#93;
    When I do
    Code:
    mysql -u root -p
    I get
    Code:
    ERROR 2002 &#40;HY000&#41;&#58; Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' &#40;2&#41;

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •