Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neo

    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

    It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
    and installed it to my Fedora system, and did *not* do anything else
    (Actually I am completely new to mysql).

    I wrote a test php script to test mysql (ftp_connect('l ocalhost',
    'root');), but got the following error:

    Warning: mysql_connect() : Can't connect to local MySQL server through
    socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

    I ran phpBB2 installation page, got the same error. But it can connect
    to mysql using my computer name. Anyone can help???
  • Joachim Mæland

    #2
    Re: Warning: mysql_connect() : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

    On Mon, 12 Apr 2004 07:06:56 -0700, Neo wrote:
    [color=blue]
    > It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
    > and installed it to my Fedora system, and did *not* do anything else
    > (Actually I am completely new to mysql).[/color]
    [..][color=blue]
    > I ran phpBB2 installation page, got the same error. But it can connect
    > to mysql using my computer name. Anyone can help???[/color]

    ps aux | grep mysql

    If mysqld's not running; start it...!

    root@localhost root]# /etc/init.d/mysql start

    --
    mvh/regards
    Joachim Mæland

    If everything seems under control, you're just not going fast enough.
    -Mario Andretti

    Comment

    • Garp

      #3
      Re: Warning: mysql_connect() : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2


      "Joachim Mæland" <jm-news@profine.ne t> wrote in message
      news:pan.2004.0 4.12.14.33.10.9 69746@profine.n et...[color=blue]
      > On Mon, 12 Apr 2004 07:06:56 -0700, Neo wrote:
      >[color=green]
      > > It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
      > > and installed it to my Fedora system, and did *not* do anything else
      > > (Actually I am completely new to mysql).[/color]
      > [..][color=green]
      > > I ran phpBB2 installation page, got the same error. But it can connect
      > > to mysql using my computer name. Anyone can help???[/color]
      >
      > ps aux | grep mysql
      >
      > If mysqld's not running; start it...!
      >
      > root@localhost root]# /etc/init.d/mysql start
      >[/color]

      Yipe! safe_mysqld, please...

      Base problem, it's not PHP that's causing the difficulty, MySQL isn't
      running a server. Get a command line MySQL client session going first.

      Garp


      Comment

      • Neo

        #4
        Re: Warning: mysql_connect() : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

        neo_in_matrix@m sn.com (Neo) wrote in message news:<96aebc0f. 0404120606.27aa 9f20@posting.go ogle.com>...[color=blue]
        > It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
        > and installed it to my Fedora system, and did *not* do anything else
        > (Actually I am completely new to mysql).
        >
        > I wrote a test php script to test mysql (ftp_connect('l ocalhost',
        > 'root');), but got the following error:
        >
        > Warning: mysql_connect() : Can't connect to local MySQL server through
        > socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2
        >
        > I ran phpBB2 installation page, got the same error. But it can connect
        > to mysql using my computer name. Anyone can help???[/color]

        Okay, Thanks for replies. But I have found out the solution myself. It
        seems that the RPM setup package did not create the socket file in
        /tmp. I did:

        ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

        and all is fine now.

        Comment

        Working...