I am a web developer who is having a hard time trying to get my scripts to connect to my new web host. The script works perfectly on my localhost (I'm using XAMPP) but once I try to use it on my web host, I get the following error:
Access denied for user 'ljvnxryi'@'server.nocdirect.in' (using password: YES)
I have changed all the information to what has been supplied by the web hosters but it is still not working. The strange bit is;
If I use a username/password combination (one specific) which was not given to me by the hosters, it lets me connect but won't let me select the database - it gives an access denied error on the selecting function.
If I use the username/password combination given to me by the hosters, I am unable to connect at all and get given the access denied error again.
Just in case anyone wants to check, here is the script I'm using to connect (with 'user', 'pass' and 'mydbname' replaced):
$con = mysql_connect('18.104.22.168', 'user', 'pass') or die(mysql_error());
$db = mysql_select_db('mydbname') or die('Selection error:<br/>'.mysql_error());