Can't connect to local MySQL server

    Date: 04/30/05 (PHP Community)    Keywords: php, mysql, database, sql

    I'm working on redesigning the layout of a site I created not long ago.  I'm using the same database and all the same funcions and whatnot, I'm just changing the layout.

    Seems easy enough, right?  No.  The code that works fine and dandy on the old version of the site is causing errors on the new version.  All I did is copy the php files containing the code to connect to the database and the functions that I use to populate the main page (look at the old version, you'll see what I mean).

    So how come on the new site, the code that worked fine before, gives me the following errors?


    Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in [php file] on [line number]

    Warning: mysql_query(): A link to the server could not be established in [php file] on [line number]
    Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    The two versions of the site are on the same server, in different folders.  Also, other parts of the new site that connect to the same database work fine.  It seems (so far) that the error is only when I call the function to populate the main page.

    Any ideas?

    Source: http://www.livejournal.com/community/php/293204.html

« Beyond Weirdness: Windows 2000 || Stumped »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home