Results 1 to 4 of 4

Thread: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

  1. #1
    Join Date
    Sep 2012
    Posts
    2

    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    so for the last hour I've been fighting with this issue and I've finally caved and turned to the forums. In my googling, I've found people that have encoutered similar problems but none are quite the same as mine. I've installed and reinstalled mySQL server multiple times and I still cannot connect to it from my terminal. Everytime I try to get on it says:
    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    In alot of the forums it says to restart my server which ive attempted, but then i get this:

    Code:
    bod@bod-desktop:~$ /etc/init.d/mysql restart
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql restart
    
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) and then start(8) utilities,
    e.g. stop mysql ; start mysql. The restart(8) utility is also available.
    start: Rejected send message, 1 matched rules; type="method_call", sender=":1.114" (uid=1000 pid=26636 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    does anyone know how I can fix this. because its driving me crazy!!

  2. #2
    Join Date
    Aug 2008
    Posts
    4,697
    There probably is an error during startup. Check /var/db/mysql/hostname.err

    http://dev.mysql.com/doc/refman/5.1/en/error-log.html

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    Quote Originally Posted by scsi View Post
    There probably is an error during startup. Check /var/db/mysql/hostname.err

    http://dev.mysql.com/doc/refman/5.1/en/error-log.html
    i did a search of the entire computer and didnt find any file called hostname.err

  4. #4
    Join Date
    Aug 2008
    Posts
    4,697
    Cause its not literally called hostname.err its whatever the hostname of your server is.

    Code:
    find /var/db -name \*.err

Similar Threads

  1. Replies: 13
    Last Post: 04-19-2012, 09:00 AM
  2. Too many PIDs (httpd+mysqld) then mysqld hangs and server get slow
    By y0us3f in forum General Technical Discussion & Troubleshooting
    Replies: 25
    Last Post: 07-15-2011, 05:38 PM
  3. Cant connect to local MySQL server through socket?
    By beansbaxter in forum General Technical Discussion & Troubleshooting
    Replies: 4
    Last Post: 03-05-2011, 02:29 AM
  4. mysqld.sock disappeared
    By amator in forum MySQL / PHP
    Replies: 3
    Last Post: 05-29-2010, 04:52 PM
  5. Replies: 4
    Last Post: 10-05-2006, 12:26 AM

Posting Permissions

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