MySQL server socket error

Discussion in 'Installation/Configuration' started by poisen, Mar 18, 2008.

  1. poisen

    poisen New Member

    Hey everybody,

    running a new install of debian etch and ISPConfig 2.2.21 and I just wanted to connect to my database through a php script and I keep getting this error message.

    mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    I did read a bunch of stuff already about this problem, but couldn't find a solution yet.

    Here my outputs:
    Code:
    delta:/# netstat -tap
    Aktive Internetverbindungen (Server und stehende Verbindungen)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
    tcp        0      0 *:10851                 *:*                     LISTEN     3336/perl           
    tcp        0      0 *:mysql                 *:*                     LISTEN     2559/mysqld         
    tcp        0      0 *:81                    *:*                     LISTEN     2975/ispconfig_http 
    tcp        0      0 *:ftp                   *:*                     LISTEN     3310/proftpd: (acce 
    tcp        0      0 delta.twinmotion:domain *:*                     LISTEN     3288/named          
    tcp        0      0 localhost:domain        *:*                     LISTEN     3288/named          
    tcp        0      0 localhost:953           *:*                     LISTEN     3288/named          
    tcp        0      0 *:smtp                  *:*                     LISTEN     3258/master         
    tcp6       0      0 *:imaps                 *:*                     LISTEN     2702/couriertcpd    
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     2721/couriertcpd    
    tcp6       0      0 *:pop3                  *:*                     LISTEN     2707/couriertcpd    
    tcp6       0      0 *:imap2                 *:*                     LISTEN     2685/couriertcpd    
    tcp6       0      0 *:www                   *:*                     LISTEN     2921/apache2        
    tcp6       0      0 *:domain                *:*                     LISTEN     3288/named          
    tcp6       0      0 *:ssh                   *:*                     LISTEN     2826/sshd           
    tcp6       0      0 ip6-localhost:953       *:*                     LISTEN     3288/named          
    tcp6       0      0 *:smtp                  *:*                     LISTEN     3258/master         
    tcp6       0      0 *:https                 *:*                     LISTEN     2921/apache2     
    
    Code:
    delta:/# ps aux | grep mysql
    root      2522  0.0  0.0   2672  1328 ?        S    13:19   0:00 /bin/sh /usr/bin/mysqld_safe
    mysql     2559  0.0  0.8 127288 17536 ?        Sl   13:19   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
    root      2560  0.0  0.0   1564   508 ?        S    13:19   0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
    root      3398  0.0  0.0   2860   696 pts/0    D+   13:22   0:00 grep mysql
    
    Code:
    delta:/# locate mysql.sock
    /var/lib/mysql/mysql.sock
    delta:/# locate mysqld.sock
    /var/run/mysqld/mysqld.sock
    
    I just don't know what to do anymore. Restarted the server already and also deleted the my.cnf and replaced it with the original version.

    I'd be thankful for some help.

    -Eddie
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The output you posted looks fine so far. Is the php script located on the same server?
     
  3. poisen

    poisen New Member

    yes, the script is on the same server. After messing around myself for awhile, I just reinstalled everything and now it is working! I don't know what was wrong, because after comparing things, everything was after the reinstall the same as before.

    Thanks for helping anyways.
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Did you maybe enable PHP Safe Mode?
     

Share This Page