The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Please Help; can't connect to MySQL server.

Discussion in 'General Discussion' started by J.Aanen, May 7, 2012.

  1. J.Aanen

    J.Aanen Registered

    Joined:
    May 7, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi, I'm now using cPanel and I was hoping someone could help me out.
    somehow I cant connect to a MySQL database that I have setup. I googled a bit but I couldn't find a proper sollution.


    the php code I am using to connect is:
    $connect = mysql_connect("mysql02.totaalholding.nl","joosta1x_admin_joosta1x_MyAlly","PASSWORD") or die("My Ally couldn't connect host");

    host=mysql02.totaalholding.nl
    Cpanel username=joosta1x
    database username=joosta1x_admin
    database name=joosta1x_MyAlly


    I'm getting the following error when trying to connect to the MySQL server:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'joosta1x_admin_j'@'ip565f0a57.direct-adsl.nl' (using password: YES) in C:\xampp\htdocs\webapp\connect\connectOnline.inc.php on line 2
    My Ally couldn't connect host

    I hope someone can tell me what I am doing wrong.

    Thankyou.

    Kind regards,

    Joost
     
  2. PlotHost

    PlotHost Well-Known Member

    Joined:
    Apr 29, 2011
    Messages:
    253
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    US
    cPanel Access Level:
    Root Administrator
    Twitter:
    Ask your hosting company if they allow connections to MySQL on port 3306.
    If they allow such connections, add your IP to the white list in cPanel->Databases->Remote MySQL
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This line doesn't seem right:

    "joosta1x_admin_joosta1x_MyAlly"

    You are stringing together the database username and database name into one long username from what I can see. Probably should be this instead:

    mysql_connect("mysql02.totaalholding.nl","joosta1x_admin","joosta1x_MyAlly","PASSWORD") or die("My Ally couldn't connect host");
     
Loading...

Share This Page