User Error in connection to db Mysql
User Error in connection to db Mysql
jalbo
Posts: 6Questions: 2Answers: 1
I have this error SQLSTATE[HY000] [1045] Access denied for user c1234_x@localhost
My code to connection is:
$sql_details = array(
'user' => 'c1234_xyz',
'pass' => 'gatorei',
'db' => 'c1234_xyz',
'host' => 'localhost',
);
// user and db have a same name.
This data is to server in the cloud (not local ).
Plis, any help is wellcome!
Thanks.
Answers
The error says
c1234_x@localhost
, but the array hasc1234_xyz
. Is that just an error in showing the text here?Either way, it suggests that your user name or password is invalid.
Allan
Hi Allan. Thanks for answering. There is an error in my transcript. The correct one is: "I have this error SQLSTATE [HY000] [1045] Access denied for user c1234_xyz '@ localhost".
The username and password are correct. I have used them from another page and they work without error.
Please, do you have another suggestion? Thanks a lot!
There are some options to look at in this SO thread. The problem is with credentials or other server configuration issue.
Kevin
Thanks!
$sql_details = array(...,'host' => 'localhost');
The server is not local (like xamp or wamp). The server is in the cloud. But this server say the value "host" is "localhost" . I use that value with other tools to connect to the database. Do I have to use another value?
Thanks!
Yep, you need to give the connection details to the database you wish to connect with!
Colin
Not sure this page is the best place to report this issue -- but since my search for previous reports brought me here, it seems reasonable to put it where other potential reporters might find it.
Two of the Server-Side Processing example pages on the DataTables Live server have the same issue @jalbo had:
live.datatables.net/examples/server_side/simple.html and
live.datatables.net/examples/data_sources/server_side.html both make an AJAX call to live.datatables.net/examples/server_side/scripts/server_processing.php, which is currently returning this error:
FYI & FWIW, the equivalent non-Live script (datatables.net/examples/server_side/scripts/server_processing.php) works properly when called by the equivalent non-Live SSP pages, datatables.net/examples/server_side/simple.html and datatables.net/examples/data_sources/server_side.html
Those URLs for the live.datatables.net site aren't quite right. You could use the links from this page as the basis for a server-side processing example on the live site.
Allan