SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upgrade hell-cant connect to DB-still stuck

    <edit: see the latest post for another question>

    Hello.

    I recently upgraded MySQL to version 5.0 , and also upgraded PHP to 5.1.2

    PHP seems to run fine. I had a glitch with loading php_mysql.dll, but that is fixed now. Unfortunatly when I try to connect to the database, I get this error
    Code:
    Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in ... file ... line number
    Using mysql from the cmd prompt I can get in with localhost, and my username and password just fine.

    I did notice something that seemed strange, when I run phpinfo(), it claims that the client API version(of MySQL) is 4.1.7, which sounds to me like it's trying to mess with the old version of sql, which should be gone now.

    I'm on XP, using sambar server 6.2

    Any ideas?
    Last edited by busy; Feb 15, 2006 at 12:42.

  2. #2
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just completely removed and reinstalled PHP 5.1.2

    I'm still getting the same error.

    Please somebody help!

  3. #3
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it's a mystery to me too. Maybe someone who has MySQL 5 and PHP 5 running properly can help me with some troubleshooting.

    Here's the first thing I need to know...

    What is the client API version number in phpinfo() under MySQL (or MySQLi)? Does this number match your version of MySQL?

    Google has uncovered similar problems with PHP trying to use an older client API for MtSQL so I hope I'm on the right track, but so far no solutions that work for me. Does anyone know how PHP decides what client API to use?

  4. #4
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn. I got my client API version up to 5.0.18 where it should be, by swapping out libmysql.dll (in system32) with the one in MySQL's bin directory, but I still can't connect. I tried it with my firewall shut down, I made sure the MySQL5 service is running...

    Any ideas of more troubleshooting steps I could follow?

  5. #5
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) can you connect to mysql without using php (from your command or shell prompt for instance)?

    2) have you read the mysql manual about using OLD PASSWORDS since you may be running into the problem with the password hashing that is not recognized by the php/mysql setup you have.

  6. #6
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, dave.

    Yes, I can connect just fine from the command prompt. In fact, I've already imported the database I need to use from there.

    I have tried setting the password with OLD_PASSWORD() with no luck. It shouldn't apply to my setup, but I tried it anyways. I also made sure to set it back with PASSWORD() after changing a few things. I also tried downloading the most recent mysql and mysqli extenstions from mysql.com and tried each one set up by itself.

    Off Topic:

    I think my computer is mad at me for setting up a linux box in the same room. That would at least explain why it's being stubborn about OS software.

  7. #7
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also - I can't log on from MySQL administrator either

  8. #8
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it!!!
    skip-networking was enabled by default for some reason in my.ini

    I commented it out, restarted the MySQL service and now everything's good!

    Thanks for trying Daveman!


Bookmarks

Posting Permissions

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