FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    Posts
    23

    mysql can't find the correct socket

    When I attempt to get mysql running I get the following:

    [root@localhost ~]# mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    Any suggestions as to what I could do will be appreciated.

  2. #2
    Join Date
    Jan 2005
    Age
    55
    Posts
    91
    I had this exact problem on fedora 3 and this is what i did to solve the problem for
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    When i was shutting the computer down i noticed that there was and error in removing the mysql.sock.....no permissions. I had monkeyed arround trying to find out what i need to give permissions too.....the i revisited my installation proceedure. I had origionally installed Fedora Core using Stanton-Finley notes. During the install it made a reference to turn off the protection for the httpd daemon. SO CLICK, the light bulb came on.

    Uninstall mysql server and mysql-max
    reinstall mysql server and mysql-max (gets rid of any errors that may have occurrd previous)

    What you need to do is to go to terminal in root

    /usr/sbin/setenforce 0
    /etc/init.d/mysql start

    This will force selinux off and start msql to get a mysql.sock started.

    Go to Applications > System Settings > Security Level and type in your root pass word

    Open the SELinux tab and under Modify SE linux policy
    open SElinux service protection and click on Disable SELinux protection for mysqld daemon.

    reboot your computer

    Everything should work..... For some reason if the you dont disable the daemon the shut down proceedure WILL NOT be granted removal priveleges for the mysql.sock.......It will be there at start up and Mysql gets all confused at this and promptly shuts down........thats why i was getting the subject errors.....LOL

    I hope this helps you or at least gives you some ideas of how to proceed with FC4.
    Last edited by DoorGunner; 1st March 2006 at 05:38 AM.

  3. #3
    Join Date
    Jul 2005
    Posts
    23
    "service mysqld restart" worked.
    Thanks.

Similar Threads

  1. cannot connect to mysql through socket..
    By Fault in forum Using Fedora
    Replies: 3
    Last Post: 19th April 2008, 07:29 PM
  2. MySQL Can't Connect Through Socket
    By lardlad in forum Servers & Networking
    Replies: 2
    Last Post: 7th December 2007, 01:54 PM
  3. MySQL Can't Connect Through Socket
    By lardlad in forum Using Fedora
    Replies: 8
    Last Post: 7th December 2007, 01:57 AM
  4. Replies: 0
    Last Post: 1st August 2007, 04:19 PM
  5. running mySQL via socket
    By StressedE in forum Servers & Networking
    Replies: 1
    Last Post: 15th August 2005, 09:05 PM

Tags for this Thread

Posting Permissions

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