Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy Connection Error

    I am new to PHP and MySQL Databases.

    I just inserted a poll to my website (The poll of www.proxy2.de). But it gives this error message:

    MySQL Error : Connection Error
    Error Number: 2002 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46)

    I suspect one of the reasons this may be happening is that I need to change Host names in the configuration files from "host" to "mysql".

    But how do I know which files are configuration files among a variety of files? And how do I know what parts of the script to change.

    Please advise.

    Thanks!

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,078
    Thanks
    11
    Thanked 98 Times in 96 Posts
    most scripts have a README or INSTALL file that contains config hints, if not look for a file with 'config' in the name, generally you will find one , if not look for a file with 'conn' or 'db' in the name, they are not usually that hard to find, alternately see if the place you got the script from has a help forum or FAQ.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    includes/config.inc.php

    PHP Code:
    $POLLDB["dbName"] = "Database name";
    $POLLDB["host"]   = "localhost";
    $POLLDB["user"]   = "Your database username";
    $POLLDB["pass"]   = "Your database password"
    That's all you need to change

  • #4
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks a lot.

    it was a lot easier than it seemed. I thought I was gonna have to work with all the files.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •