Cannot Connect to MySQL Database - Access Denied

Status
Not open for further replies.

noisetes

New Member
Messages
2
Reaction score
0
Points
1
Hello, I am very impressed with your web hosting and the features that are offered. After setting up and uploaded my website that I have been developing on a test server, everything worked fine apart from it cannot connect to the MySQL database. After lots of troubleshooting I created a simple php file to test the connection.

This is the php file I created:
PHP:
<?php

$conn = mysql_connect("localhost", "noisetes_user1", "**********") or die ('Error connecting to mysql');

?>

This is the output:

HTML:
<br>
<b>Warning</b>:  mysql_connect(): Access denied for user 'noisetes_user1'@'localhost' (using password: YES) in <b>/home/noisetes/public_html/testdb.php</b> on line <b>8</b><br>
Error connecting to mysql

I have ensured the user is created in cPanel and phpmyadmin.
 

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
The user I see when looking at your cPanel is NOT the same as you have up in the code snippet. I see: noisetes_u1
 

noisetes

New Member
Messages
2
Reaction score
0
Points
1
I've been an idiot and was looking at my testing machine's users and not my phpmyadmin on my x10 account, got it sorted now.

Cheers for the fast reply :) How do I close this thread?
 
Status
Not open for further replies.
Top