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!

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:
    51
    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:
    255
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    Romania
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    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");
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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