Can't connect to the MySQL-Server through PHP - BSD

This is a discussion on Can't connect to the MySQL-Server through PHP - BSD ; Hello, I've got a problem connecting to the MySQL-Server with a PHP-script. The facts: OpenBSD 4.2 MySQL-Server 5.0 Default Apache Webserver PHP 5.2.3 The MySQL socket lies in /var/www/run/mysql/: # ls -la /var/www/run/mysql/ drwxrwxrwx 2 _mysql _mysql 512 Jan 25 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Can't connect to the MySQL-Server through PHP

  1. Can't connect to the MySQL-Server through PHP

    Hello,
    I've got a problem connecting to the MySQL-Server with a PHP-script.
    The facts:
    OpenBSD 4.2
    MySQL-Server 5.0
    Default Apache Webserver
    PHP 5.2.3

    The MySQL socket lies in /var/www/run/mysql/:
    # ls -la /var/www/run/mysql/

    drwxrwxrwx 2 _mysql _mysql 512 Jan 25 11:39 .
    drwxr-xr-x 3 root daemon 512 Jan 23 20:01 ..
    srwxrwxrwx 1 _mysql _mysql 0 Jan 25 11:39 mysql.sock

    The MySQL-socket-path line in the php.ini:
    mysql.default_socket = /run/mysql/mysql.sock;

    Everytime I open the PHP-Script which tries to connect to a MySQL-
    database in my browser I get the simple error:
    "Can't connect to local MySQL server through socket '/run/mysql/
    mysql.sock'"

    What is wrong here?

    Greetings
    Rainer Hihn

  2. Re: Can't connect to the MySQL-Server through PHP

    Am Fri, 25 Jan 2008 07:53:31 -0800 schrieb Rainer Hihn:

    Hi Rainer,

    > The MySQL socket lies in /var/www/run/mysql/:
    > # ls -la /var/www/run/mysql/
    >
    > drwxrwxrwx 2 _mysql _mysql 512 Jan 25 11:39 .
    > drwxr-xr-x 3 root daemon 512 Jan 23 20:01 ..
    > srwxrwxrwx 1 _mysql _mysql 0 Jan 25 11:39 mysql.sock
    >
    > The MySQL-socket-path line in the php.ini:
    > mysql.default_socket = /run/mysql/mysql.sock;


    try mysql.default_socket = /var/www/run/mysql/mysql.sock

    > "Can't connect to local MySQL server through socket '/run/mysql/
    > mysql.sock'


    you're looking in the wrong directory, you wrote that your socket is in
    /var/www/run/mysql located.

    cheers

+ Reply to Thread