Hello, I am trying to access a link in website and I got the following error message. I cannot detect the problem. I don't know much about the script but I believe it should be able to do it once I get guidance.
Thanks


Warning: mysql_connect(): Access denied for user: 'htcom@localhost' (Using password: YES) in /home/u1/htcom/html/ecards/include/db_mysql.inc.php on line 37

A { text-decoration : none; }TD,TH,P,BR,BODY,LI { font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;}FORM,INPUT,OPTION,SELECT,TEXTAREA { font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;} sound_fileURL = ''; MsgWinMusicNote = 'Choisissez une option.'; query_string = ''; SVP activez le javascript !

KHÂDIMU-R-RASÛL
Retour au site
HIZBUT TARQIYYAH


Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/u1/htcom/html/ecards/include/db_mysql.inc.php on line 90


Database error in vCard Lite:Invalid SQL: SELECT * FROM card_imgcat ORDER BY cat_namemysql error: Access denied for user: 'htcom@localhost' (Using password: YES)mysql error number: 1045Date: 2004/07/01 - 05:15:03 PMScript: /ecards/Referer:

Dani AI

Generated

The problem is an authentication/connection failure: PHP is not getting a valid MySQL link and subsequent queries fail. was right to first check username/password, and ’s idea of trying root can be a quick diagnostic — but do not leave root in a production config. ’s move to the PHP area is appropriate because this is a DB-connection issue inside the script.

Quick troubleshooting checklist:

  • Confirm the DB settings the app actually uses (host, username, password, database). Webapps sometimes load a different config file than the one you edit.
  • Test the credentials from the server itself. If you have shell access use the mysql client (or create a tiny PHP test) to see whether the server accepts the credentials from that host.
  • Check the DB “host” semantics: MySQL distinguishes user@host. On many systems “localhost” uses a Unix socket while “127.0.0.1” uses TCP; a user granted for one host may not match the other.
  • Verify privileges: the DB account must have appropriate rights on the specific database. If you can access the server as an admin, grant the needed rights and run FLUSH PRIVILEGES.
  • Confirm the PHP environment: ensure the code’s extension (mysql vs mysqli vs PDO) matches your PHP version. Old mysql_* calls are removed in current PHP releases — migrate to mysqli or PDO when possible.
  • Watch for quoting/escaping issues or special characters in the password, and check file permissions so the webserver can read the config but it’s not world-readable.

Simple mysqli test (replace placeholders and run once, then remove):

<?php
$mysqli = new mysqli('HOST','DBUSER','DBPASS','DBNAME');
if ($mysqli->connect_errno) {
    echo 'Connect error: '.$mysqli->connect_error;
    exit;
}
echo "Connection OK";
?>

If the connection still fails, post a sanitized connection snippet plus PHP and MySQL versions and how you tested (CLI or a small script). Do not post real passwords.

Recommended Answers

All 3 Replies

you either misstyped your user name and password or the site admin never granted you the right to login to the mysql database. double check your username/password. if its right you account on mysql is not confuigred correctly!

edit: this should be in the PHP forum!

You could always try using root as the user name and see if you get the same problem.

Ditto on what BinaryMayhem said. Oh, and off this goes to the PHP forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.