Results 1 to 8 of 8

Thread: MySQL connectivity

  1. #1
    Join Date
    Jul 2003
    Posts
    424
    Rep Power
    0

    Default MySQL connectivity

    Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 25

    Converted an ASP to PHP using ASP2PHP however I am getting the above error. I am not sure as to how to setup mysql, however I have it installed. Is that all that is necessary?

    What is the equivalent to the following connection?
    $strSource="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=".$strDBLocation;

    I am using apache on linux 9.0


  2. #2
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re:MySQL connectivity

    [quote author=Weird_O link=board=22;threadid=1606;start=0#msg15324 date=1061304413]
    What is the equivalent to the following connection?
    $strSource="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=".$strDBLocation;
    [/quote]

    Use these functions in the given order:

    mysql_connect('<server>', '<user>', '[password]'
    mysql_select_db('<database_name>'

    If you haven't configured MySQL since it's initial install, then username "root" with a blank password will exist. Or is it username: "root", password: "root"? hmmm....one of the above will work.

    P.S. you may also use "mysql_pconnect()" to make a persistent connection to the database. This is useful if you plan to make multiple calls to the server on one page.

  3. #3
    Join Date
    Jul 2003
    Posts
    424
    Rep Power
    0

    Default Re:MySQL connectivity

    I have made the replacement however I still have the following errors.

    Warning: Can't connect to MySQL server on '172.17.21.125' (111) in /var/www/html/directory/byname.php on line 15

    Warning: MySQL Connection Failed: Can't connect to MySQL server on '172.17.21.125' (111) in /var/www/html/directory/byname.php on line 15

    Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 16

    Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 16

    Warning: MySQL: A link to the server could not be established in /var/www/html/directory/byname.php on line 16

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/directory/byname.php on line 39

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/directory/byname.php on line 40

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/directory/byname.php on line 47

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/directory/byname.php on line 48

  4. #4
    Join Date
    May 2003
    Posts
    137
    Rep Power
    0

    Default Re:MySQL connectivity

    Is the IP address [172.17.21.125] hard coded in your script ? Is this a relevant address?

    Should the 'server' be "localhost" in this case ?

  5. #5
    Join Date
    Jul 2003
    Posts
    424
    Rep Power
    0

    Default Re:MySQL connectivity

    The IP address is not hard coded in the script, however it is the correct address.

    I don't know waht it should be... ???

  6. #6
    Join Date
    May 2003
    Posts
    137
    Rep Power
    0

    Default Re:MySQL connectivity

    What is the IP address in reference to ?

  7. #7
    Join Date
    Jul 2003
    Posts
    424
    Rep Power
    0

    Default Re:MySQL connectivity

    Sorry about the trouble Stan, I substituted server with localhost alone with a host of other things. However the real problem was that Mysql was not staying up when it started. I had to uninstall the package and re-install, got it work.

    Thanx for the help guys.

  8. #8
    Join Date
    May 2003
    Posts
    137
    Rep Power
    0

    Default Re:MySQL connectivity

    No problemo

Posting Permissions

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