Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    2

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

    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. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    It could be the hash sign in the password. This is really something you need to ask your hosting provider about, though.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    2

    Default 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
    Last edited by proudlyphp; 07-30-2008 at 08:45 AM.

Similar Threads & Tags
Similar threads

  1. Replies: 8
    Last Post: 02-07-2011, 11:06 AM
  2. Replies: 3
    Last Post: 02-05-2011, 11:51 PM
  3. Wrong username/password. Access denied.
    By jsnape in forum cPanel and WHM Discussions
    Replies: 28
    Last Post: 02-12-2004, 11:48 PM
  4. ERROR 1045: Access denied for user: 'root@localhost'
    By Jontxu40 in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 08-17-2003, 04:25 PM
  5. 1045 Access denied for user: 'fhca@localhost' (Using passwor
    By nitromax in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 07-09-2002, 04:35 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube