Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Northern Ohio
    Posts
    74
    Rep Power
    14
    I received the following error '#2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) ' when trying to connect to a search engine I installed. Previously I installed Mysqltool and received a similar meesgae when trying to connect 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)'. I am running Redhat 7.0 with all updates applied with an apache webserver.

    I am using the RPM version of mysql 3.23.32-1.7. I have read about problems with the rpm, yet not of the suggestions to fix it seem to work. I like the RPM management system, so I would like to avoid compiling this if possible.

    I appreciate any responses I can get.
  2. #2
  3. yet another member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    262
    Rep Power
    14
    Hi!

    Have you checked whether mysql.sock is there? I have mine in /tmp and did some cleanup work there once and recieved similar messages after having deleted it

    A restart of your mysqld restores it. Have you tried that or rebooted??


    Greetings

    Atrus.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Northern Ohio
    Posts
    74
    Rep Power
    14
    I checked the socket....

    [root@cinnixia /var/lib/mysql]# ll
    total 20k
    drwx------ 5 mysql mysql 4.0k Apr 27 18:37 .
    drwxr-xr-x 5 root root 4.0k Apr 16 23:15 ..
    drwx------ 2 mysql mysql 4.0k Apr 27 18:47 mnoGoSearch
    drwx------ 2 mysql mysql 4.0k Apr 16 23:13 mysql
    srwxrwxrwx 1 mysql mysql 0 Apr 27 16:51 mysql.sock
    drwx------ 2 mysql mysql 4.0k Apr 27 17:55 test.

    Everything looks like it is where it is supposed to be with the correct permissions. But feel free to correct me if I am wrong.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Northern Ohio
    Posts
    74
    Rep Power
    14
    Yeah I also tried rebooting too, although it made no change to the problem.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    14
    Rep Power
    0
    I had this problem alot, but not any more. I think it's related to permissions. From the command line type:

    mysql_install_db
    safe_mysqld &
    mysql

    You might also need to first change to the mysql user like so:

    su mysql

    This should work.
    Last edited by crash_nic; May 3rd, 2001 at 12:19 PM.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    2
    Rep Power
    0
    I am having the same problem and I tried the above. Still I can't access. The error says: Access denied for user: 'root@localhost' (Using password: YES)'
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    4
    Rep Power
    0

    Now this is something else


    Your prolem is something else, check username and password for your mysql and the password you are trying to login with !


    Originally Posted by Mikil
    I am having the same problem and I tried the above. Still I can't access. The error says: Access denied for user: 'root@localhost' (Using password: YES)'
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    1
    Rep Power
    0

    The problem is SELinux!


    Howdy,

    I have been having the same problem and I have found the solution -- at least for me. The problem for me is that I had just installed Fedora Core 3. Starting with Fedora Core 3, SELinux is turned on by default. SELinux is the Secure Edition that has extra security features. I turned SELinux off and I stopped getting the error. I will do some more research and see if I can just turn off parts of SELinux to get MySQL to work with PHP and Apache.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    1
    Rep Power
    0

    SELinux


    I had the same problem and the only way I could get it to work was by using weedguy's solution.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    2
    Rep Power
    0

    How do you turn off SELinux?


    How do you turn off SELinux?

    Thanks in advance.


    Originally Posted by weedguy
    Howdy,

    I have been having the same problem and I have found the solution -- at least for me. The problem for me is that I had just installed Fedora Core 3. Starting with Fedora Core 3, SELinux is turned on by default. SELinux is the Secure Edition that has extra security features. I turned SELinux off and I stopped getting the error. I will do some more research and see if I can just turn off parts of SELinux to get MySQL to work with PHP and Apache.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    853
    Rep Power
    12
    Originally Posted by phishhead
    How do you turn off SELinux?

    Thanks in advance.
    by setting the SELINUX line in /etc/sysconfig/selinux to Disabled:

    SELINUX=Disabled
    Contact info:
    Primary email: advanced.programmer@gmail.com
    MSN/email: superprg@hotmail.com
    AIM: superprg
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    1
    Rep Power
    0
    Just in case: This error message appears as well when the password is incorrect. The procedure to set a new root password without knowing the old one is described under:
    http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    1
    Rep Power
    0
    I think you might want to check the permissions for the /var/lib/mysql/ folder. The actual folder needs to be 'xr' for group and 'x' for anyone. So, from your:

    [root@cinnixia /var/lib/mysql]# ll
    total 20k
    drwx------ 5 mysql mysql 4.0k Apr 27 18:37 .
    drwxr-xr-x 5 root root 4.0k Apr 16 23:15 ..
    drwx------ 2 mysql mysql 4.0k Apr 27 18:47 mnoGoSearch
    drwx------ 2 mysql mysql 4.0k Apr 16 23:13 mysql
    srwxrwxrwx 1 mysql mysql 0 Apr 27 16:51 mysql.sock
    drwx------ 2 mysql mysql 4.0k Apr 27 17:55 test.

    I think it might need to be:

    drwxr-xr-x 5 mysql mysql 4096 Jan 4 18:08 ./
    drwxr-xr-x 16 root root 4096 Jan 4 17:31 ../
    drwx------ 2 mysql mysql 4096 Jan 4 17:39 mysql/
    srwxrwxrwx 1 mysql mysql 0 Jan 4 17:39 mysql.sock=

    To do this, try

    root#> chmod 755 /var/lib/mysql/
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    1
    Rep Power
    0
    Originally Posted by weedguy
    Howdy,

    I have been having the same problem and I have found the solution -- at least for me. The problem for me is that I had just installed Fedora Core 3. Starting with Fedora Core 3, SELinux is turned on by default. SELinux is the Secure Edition that has extra security features. I turned SELinux off and I stopped getting the error. I will do some more research and see if I can just turn off parts of SELinux to get MySQL to work with PHP and Apache.
    this is the procedure I've followed to configure SELinux :

    From Startmenu select
    "System settings"
    Then choose
    "Security settings or security level"
    A window appears with 2 tabs : "Firewall options" and "SELinux"
    Choose SELinux.
    At the bottom half of the window you have a lisbox, listing (at least on my PC)

    HTTPD Service
    Name Service
    NIS
    SELinux Service Protection

    Open SELinux Service Protection
    Select "Disable SELinux protection for mysqld daemon"
    Click "OK"

    Open HTTPD Service
    Select "Disable SELinux protection for httpd daemon"
    Click "OK"

    you had to reboot to make it work

    Bye.
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Location
    Menlo Park, CA
    Posts
    2
    Rep Power
    0

    Sufficient to just disable httpd daemon protection (also no reboot)


    In my Fedora Core 3 (in which I have already run "fixfiles reset"), I was able to get a PHP call to mysql_connect() working by just disabling the SELinux protection of the httpd daemon (as described in the previous submission to this thread). I left the protection of the mysql daemon running. Then:

    # /etc/init.d/httpd restart
    # /etc/init.d/mysqld restart (for good measure, probably not necessary)

    Now things work (without the reboot mentioned in the previous contribution).

    Hope this narrows things down.

    Also, see next post for the *REAL* fix.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo