Closed Thread
This thread has been escalated.
Results 1 to 6 of 6

Thread: Access denied - MySQL PHP connection

  1. #1
    iscreamd83 is offline x10Hosting Member iscreamd83 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    3

    Question Access denied - MySQL PHP connection

    Hi,

    I've been trying to connect to MySQL on my site, using php mysql_connect.
    This is the code:

    -------------------
    <?php
    $dbhost = "localhost";
    $dbuser = "iscream_testuser";
    $dbpass = "censored";
    $database ="iscream_testdb";
    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    @mysql_select_db($database) or die( "Attempt to connect has failed.");
    ?>
    -------------------

    The error I get:

    -----------
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'iscream_testuser'@'10.33.248.81' (using password: YES) in /home/iscream/public_html/mysql_connect.php on line 6
    Error connecting to mysql
    -----------

    Can anyone point to the error what's causing it? I've searched for solutions but haven't found any. By the way, the password is 100% sure, the user has all privileges set for the database.

    Thanks in advance,
    iScream

  2. #2
    MaestroFX1's Avatar
    MaestroFX1 is offline Community Advocate MaestroFX1 has a spectacular aura about
    Join Date
    Feb 2008
    Location
    Area 51
    Posts
    1,577

    Re: Access denied - MySQL PHP connection

    Could you please post the ips listed under cpanel >> remote mysql ?

  3. #3
    iscreamd83 is offline x10Hosting Member iscreamd83 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    3

    Re: Access denied - MySQL PHP connection

    On that page the only thing it displays: Access Host | Cpanel::Mysql=HASH(0x7063e10).
    I'm new to PHP & MySQL so I don't know what that means.
    And if it matters I'm on free hosting. But I still should be able to connect to MySQL using PHP right?

    Thanks for the help
    iScream

  4. #4
    stpvoice's Avatar
    stpvoice is offline Community Support Rep stpvoice has a brilliant futurestpvoice has a brilliant futurestpvoice has a brilliant future
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    5,939

    Re: Access denied - MySQL PHP connection

    Yes, you should be able to use php/MySQL.

    Just to confirm, there should be a table with 2 columns. One with "Access Hosts" and the other with a remove button. Could you just tell us what's in the rows, if any? It'll be numbers like 11.22.33.% etc.


  5. #5
    iscreamd83 is offline x10Hosting Member iscreamd83 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    3

    Re: Access denied - MySQL PHP connection

    As I said, it displays Cpanel::Mysql=HASH(0x7063e10)
    Image for proof:

  6. #6
    stpvoice's Avatar
    stpvoice is offline Community Support Rep stpvoice has a brilliant futurestpvoice has a brilliant futurestpvoice has a brilliant future
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    5,939

    Re: Access denied - MySQL PHP connection

    Okay. Thanks for that.
    I'm going to escalate this for an admin to sort out, as there should be more entries there, but can't be added from the frontend because of restrictions.

    Thank you for your co-operation.


Closed Thread

Similar Threads

  1. mysql access denied from php
    By roshn.singh65 in forum Free Hosting
    Replies: 3
    Last Post: 03-26-2011, 09:49 AM
  2. access denied to cPanel / mySQL data base no connection
    By constantin.bakagiannis55 in forum Free Hosting
    Replies: 1
    Last Post: 06-29-2010, 08:01 AM
  3. MySQL access denied
    By luigidavinci in forum Free Hosting
    Replies: 0
    Last Post: 01-28-2009, 03:11 PM
  4. mysql access denied
    By ufclan in forum Free Hosting
    Replies: 6
    Last Post: 02-28-2008, 11:21 PM
  5. Replies: 3
    Last Post: 02-14-2008, 01:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers