Stupid mysql.sock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • helimeef
    New Member
    • Sep 2007
    • 77

    Stupid mysql.sock

    Hi. I am trying to set up MySQL on Unix (Mac OS X). When I try to start mysql with the terminal command
    Code:
    /usr/local/mysql/bin/mysql --user=root --password=my_pass
    I receive the error:
    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    I just had it working yesterday! Before it restarted...
    And yes I have looked at my.cnf to make sure it is pointing in the right place.

    Also, when I run PhpMyAdmin I receive the same error. PHP is also pointing in the right place. Could this just be a case of mysql.sock not existing?
    Thanks,
    Steven.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by helimeef
    Hi. I am trying to set up MySQL on Unix (Mac OS X). When I try to start mysql with the terminal command
    Code:
    /usr/local/mysql/bin/mysql --user=root --password=my_pass
    I receive the error:
    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    I just had it working yesterday! Before it restarted...
    And yes I have looked at my.cnf to make sure it is pointing in the right place.

    Also, when I run PhpMyAdmin I receive the same error. PHP is also pointing in the right place. Could this just be a case of mysql.sock not existing?
    Thanks,
    Steven.
    Try running the mysqld_safe command first.

    Comment

    • helimeef
      New Member
      • Sep 2007
      • 77

      #3
      Originally posted by r035198x
      Try running the mysqld_safe command first.
      Thanks for the help; but I just removed my MySQL directory and I'm compiling it from the source. HOPEFULLY, it will work.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by helimeef
        Thanks for the help; but I just removed my MySQL directory and I'm compiling it from the source. HOPEFULLY, it will work.
        Chances are MySQL simply did not start automatically after you restarted the machine and all you needed to do was start it manually.

        Comment

        • helimeef
          New Member
          • Sep 2007
          • 77

          #5
          Originally posted by r035198x
          Chances are MySQL simply did not start automatically after you restarted the machine and all you needed to do was start it manually.
          Well I typed in:
          Code:
          /usr/local/mysql/bin/mysqld_safe
          And I received this load of bollocks:
          Code:
          touch: /usr/local/mysql/data/new-host.home.err: Permission denied
          chown: /usr/local/mysql/data/new-host.home.err: Permission denied
          Starting mysqld daemon with databases from /usr/local/mysql/data
          /usr/local/mysql/bin/mysqld_safe: line 380: /usr/local/mysql/data/new-host.home.err: Permission denied
          rm: /usr/local/mysql/data/new-host.home.pid: Permission denied
          /usr/local/mysql/bin/mysqld_safe: line 388: /usr/local/mysql/data/new-host.home.err: Permission denied
          STOPPING server from pid file /usr/local/mysql/data/new-host.home.pid
          tee: /usr/local/mysql/data/new-host.home.err: Permission denied
          080313 15:05:58  mysqld ended
          tee: /usr/local/mysql/data/new-host.home.err: Permission denied
          I have no idea what's going on... I'm new to Unix (I just switched from Windows last week), and I'm very confused...

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by helimeef
            Well I typed in:
            Code:
            /usr/local/mysql/bin/mysqld_safe
            And I received this load of bollocks:
            Code:
            touch: /usr/local/mysql/data/new-host.home.err: Permission denied
            chown: /usr/local/mysql/data/new-host.home.err: Permission denied
            Starting mysqld daemon with databases from /usr/local/mysql/data
            /usr/local/mysql/bin/mysqld_safe: line 380: /usr/local/mysql/data/new-host.home.err: Permission denied
            rm: /usr/local/mysql/data/new-host.home.pid: Permission denied
            /usr/local/mysql/bin/mysqld_safe: line 388: /usr/local/mysql/data/new-host.home.err: Permission denied
            STOPPING server from pid file /usr/local/mysql/data/new-host.home.pid
            tee: /usr/local/mysql/data/new-host.home.err: Permission denied
            080313 15:05:58  mysqld ended
            tee: /usr/local/mysql/data/new-host.home.err: Permission denied
            I have no idea what's going on... I'm new to Unix (I just switched from Windows last week), and I'm very confused...
            Did you install MySQL as root?

            Comment

            • helimeef
              New Member
              • Sep 2007
              • 77

              #7
              I compiled MySQL under root (by using "su -" and then typing in my password), and when I run /usr/local/mysql/bin/mysql I get "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)", and running /usr/local/mysql/bin/mysqld_safe I get the same crap I got in my last post.
              I wish I know what I did 2 days ago when I got it to work... Something on drupal.com that told me how to "configure MySQL for drupal" and it ended up fixing my problem... I just wish I could find the page again, and after 2 hours of searching, I gave up.

              Comment

              Working...