Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Access denied for user 'swhisa_swhisa'@'localhost' (using password: YES).

Discussion in 'Database Discussion' started by proudlyphp, Jul 30, 2008.

  1. proudlyphp

    proudlyphp Registered

    Joined:
    Jul 29, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    I am a newbie for cPanel. Recently, we registered for cPanel and I am assigned to administer the web-based database management system. Since we are client to the www.cpanel.net and we get the access through the username and pasword. Once we are connected to this panel, I have access to the MySql database through the username and password using and php code. That is the process.

    Below is what I have been doing. I have set privileges in the PhpMyAdmin. I have given you the php connection code. And finally I tried everything with an query string, the last php code I showed you.

    Users in swhisadb
    swhisa_swhisa (Privileges: ALL PRIVILEGES)

    And again I wrote the code inside the connecttodb.php just after connecting, as you recommended. I will show you the improved code and the new error message I got as below:

    The following is the connection string.

    Code: ( text )

    1. <?php
    2. define('MYSQL_HOST','localhost');
    3. define('MYSQL_USER','swhisa_swhisa');
    4. define('MYSQL_PASS','#nd3R');
    5. define('MYSQL_DB','swhisa_swhisadb');
    6. if(!mysql_connect (MYSQL_HOST, MYSQL_USER, MYSQL_PASS)){die (mysql_error()); } mysql_select_db(MYSQL_DB);
    7.
    8. $grt = "GRANT ALL ON *.* TO 'swhisa_swhisa'@'%'";
    9. mysql_query($grt) or die(mysql_error());
    10.
    11. ?>

    The following is the insert query string
    Code: ( text )

    1.
    2.
    3. <?php
    4. ob_start();
    5.
    6. include ('../common/connecttodb.php');
    7. echo "Connection Successful!<br>";
    8.
    9. $sho = "INSERT INTO `swhisadb`.`tblsug` SET `2ma`=445";
    10. mysql_query($sho) or die(mysql_error());
    11.
    12. header('Location:../index.php');
    13.
    14. ob_end_flush();
    15. ?>



    After all this, I have the following new error message: Access denied for user 'swhisa_swhisa'@'localhost' (using password: YES).

    What is going wrong? Please help.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,470
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    It could be the hash sign in the password. This is really something you need to ask your hosting provider about, though.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. proudlyphp

    proudlyphp Registered

    Joined:
    Jul 29, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    still the same problem

    Thank you. As per your comment, I removed the hash sign and changed my password to nd3R123. But still the problem is the same error message as Access denied for user 'swhisa_swhisa'@'localhost' (using password: YES).

    Please help
     
    #3 proudlyphp, Jul 30, 2008
    Last edited: Jul 30, 2008
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice