The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

phpBB : Critical Error

Discussion in 'General Discussion' started by kekays, Apr 24, 2005.

  1. kekays

    kekays Active Member

    Joined:
    Nov 2, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    Mysql is running fine in our FreeBSD 4.11-STABLE server. I am getting error while accessing the site.which is a phpbb forum
    ---------------------------------------------------------------------------------------------------------------------------------
    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (61) in /usr/home/username/public_html/db/mysql4.php on line 48

    Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /usr/home/username/public_html/db/mysql4.php on line 330

    Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /usr/home/usernamepublic_html/db/mysql4.php on line 331
    phpBB : Critical Error

    Could not connect to the database
    ----------------------------------------------------------------------------------------------------------------------------------
    ---------------------------------------------------------------------------------------------------------------------------------
    #df -h
    /dev/ad0s1a 1008M 265M 662M 29% /
    /dev/ad0s1f 65G 18G 43G 29% /usr
    /dev/ad0s1e 5.9G 1.2G 4.3G 22% /var
    procfs 4.0K 4.0K 0B 100% /proc
    /tmp 1008M 265M 662M 29% /var/tmp
    ---------------------------------------------------------------------------------------------------------------------------------
    I cant change my /etc/my.cnf. Because all other sites and scripts are working based on that.
    --------------------------------------------------------------------------------------------------------
    #/etc/my.cnf
    client]
    socket=/tmp/mysql.sock

    [mysqld]
    set-variable = max_connections=2500
    safe-show-database
    socket=/tmp/mysql.sock
    ---------------------------------------------------------------------------------------------------
    if i change the socket to

    socket=/var/tmp/mysql.sock
    the forum site will work............ but none of the scripts won't connect to database.
    it won't work. Also we can't restart mysql from WHM. The satus will always shows failed. :(

    Any help or suggestions will be greatly appreciated. Please help.............
     
  2. flashweb

    flashweb Well-Known Member

    Joined:
    Mar 13, 2003
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Try this

    cd /var/tmp/
    ln -fs /var/lib/mysql/mysql.sock /var/tmp/mysql.sock
     
  3. kekays

    kekays Active Member

    Joined:
    Nov 2, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Getting the same error :(
     
  4. flashweb

    flashweb Well-Known Member

    Joined:
    Mar 13, 2003
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Find find path to mysql.sock

    locate mysql.sock

    Then make a sym link to that file from

    /var/tmp/mysql.sock
     
  5. kekays

    kekays Active Member

    Joined:
    Nov 2, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    I locate mysql.sock,

    /usr/local/lib/mysql.sock
    srwxrwxrwx 1 mysql wheel 0 Apr 25 18:06 /tmp/mysql.sock
    srwxr-xr-x 1 root wheel 20 Apr 24 04:17 /var/tmp/mysql.sock -> ../../tmp/mysql.sock
    i just create a link to /var/tmp/mysql.sock. but got thsi error message
    ln: `/var/tmp/mysql.socki': File exists . So that i tried this with ln -fs. existing link overwrite. Bust still i have the same issue :( . anywone can help me,
    Thanks in advance
     
  6. electron33

    electron33 Well-Known Member

    Joined:
    Feb 24, 2004
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    16
    try this:

    killall -9 mysqld
    /etc/rc.d/init.d/mysql start
     
  7. kekays

    kekays Active Member

    Joined:
    Nov 2, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    After all my site is up now but scripts are not woking
    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (2) in
     
  8. kekays

    kekays Active Member

    Joined:
    Nov 2, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Hi :)
    After all i got solution. The issue was due to the /var/tmp is mounted to /tmp. i umount it forcefully and delete sock entry from my.cnf. After then i restart mysql..
    -----------------------------------------------------------------------------------
    #umount -f /var/tmp

    # vi /etc/my.cnf
    [mysqld]
    set-variable = max_connections=2500
    safe-show-database

    # /etc/rc.d/init.d/mysql stop

    # /etc/rc.d/init.d/mysql start

    Thank you All....... :D
     
  9. electron33

    electron33 Well-Known Member

    Joined:
    Feb 24, 2004
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    16
    Excellent :)

    Thanks for letting us know how you finally resloved the problem.

    I hate those posts that people get others involved and right in the end you see "problem solved".. and nothing else.
     
Loading...

Share This Page