Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    111

    Default PHP Won't connect to mySQL

    Hi Guys, for some reason, no PHP will connect to mySQL.

    The server will connect to the mySQL via command line, but when we try and access the databases via PHP, we are getting access denied.

    For some reason, the PHP just ignores the data we have sent for accessing the databases.. ie I will give the following example:

    cpanel username: axe
    db username: axe_uname
    db dbname: axe_database
    db password: anythinggoes

    Ok, when we try and connect, it ignores what we have set, and displays the following error:

    mysql://axe_database:@localhost/axe_uname failed to connectAccess denied for user 'axe'@'localhost' (using password: NO)

    Anyone got any ideas?

    I've recompiled apache with so many different combinations trying to get it working, and nothing budges!

  2. #2
    Member
    Join Date
    Jun 2004
    Posts
    111

    Default

    Oh and its PHP 4.4.2 with mySQL 4.1.21

  3. #3
    Member
    Join Date
    Jun 2004
    Posts
    111

    Default

    <ack, barfed forum times for some reason>
    Last edited by deanstev; 02-25-2007 at 06:06 AM.

  4. #4
    Member
    Join Date
    Apr 2005
    Posts
    318

    Default

    I think this is your problem "(using password: NO)".
    http://www.crohoster.com/
    quality hosting services and managed dedicated servers

  5. #5
    Member
    Join Date
    Jun 2004
    Posts
    111

    Default

    Thing is, we sent the password
    PHP is ignoring it.

    I don't get it.

  6. #6
    Member
    Join Date
    Apr 2005
    Posts
    318

    Default

    Have you checked mysql error logs?

    It is possible that mysql is not started with switch useoldpassword
    http://www.crohoster.com/
    quality hosting services and managed dedicated servers

  7. #7
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Check your php.ini file and make certain sql.safe_mode = Off

    If it equals On, that is your problem.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    1

    Default

    Hello,

    Was this sorted out? I have the same issue. Mysql was set to use old passwords and safe_mode set to off. But the issue persists.

  9. #9
    Member
    Join Date
    Oct 2003
    Posts
    21

    Default

    Hi,

    I'm having this problem also, and would like to see if anyone came across a solution!

    Please post if you know of anything that may resolve this!

Similar Threads & Tags
Similar threads

  1. Help! Can't connect MySQL after upgraded PHP 4.4.4 to 4.4.7
    By taotoon in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 04-25-2008, 02:33 PM
  2. Some Mysql Databases won't PHP query - PHP 4.3.10
    By noimad1 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-26-2005, 03:56 PM
  3. Php scripts cannot connect to MySQL
    By anzix in forum Database Discussions
    Replies: 8
    Last Post: 08-12-2004, 08:12 PM
  4. HELP php can't connect to mysql anymore
    By jamesbond in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-07-2003, 10:30 PM
  5. Can't connect to MySQL from PHP
    By avara in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-28-2002, 04:46 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube