Good morning,
I wrote the code block below on my local PC with Windows 7 and tried to run it. Sorry, I received:
Connect Error (1045) Access denied for user 'dbuser'@'myhost(using password: YES)
I provided dbuser Insert, Select, Update, and Execute using localhost and% for this database schema. I can also mysql -u dbuser -p from the command line on the server.
Here's the code block:
<?php $host="serveripaddress"; $db="dbname"; $username="dbuser"; $pass="pass"; $mysqli=new mysqli($host,$username,$pass,$db); if (mysqli_connect_error()){ die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); echo 'Success... ' . $mysqli->host_info . "\n"; $mysqli->close(); } ?>
I am having difficulty understanding whether the above code block causes my error or if something needs to be done on the server. Can anyone suggest some areas of investigation?
Thanks Sid
source share