Please Help; can't connect to MySQL server.

J.Aanen

Registered
May 7, 2012
1
0
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
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
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");