Hi,

I have used phpadmin to add a new database, a user, and a localhost at my host as follows:

test
mylogin
mypasswd
%

I have also added data using phpadmin sql function and verified that it is there.

The problem is that when I attempt to access the data via html/php I receive the following message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'mylogin@localhost' (Using password: YES) in /home/mydomain/public_html/php_/common.inc on line 14
Sorry, could not connect to database server.

Can someone tell me what I might be doing wrong since the same setup works on my linux system without the phpadmin though.

Peter

    canyou please post the script you are using..

    might be theres some thing worng in the way you are trying ro connect the db

    does it show the apache server is running ???

      This part of the script is in my common.inc file as a function.

      		
      function test_db_connect()
      {
      	$link = mysql_connect ("%","mylogin","mypasswd");
      	if ($link && mysql_select_db ("testbd"))
      	   return ($link);
      	return (false);
      }
      PHP] 
      
      This is in my php file.
      
      [code=php]		
      if (!test_db_connect ())
      	print ("Sorry, could not connect to database server.<BR>
      	Please try again at another time. \n");
      PHP] 
      
      I originally tried "localhost" in place of the % but that didn't seem to work either.
      
      Peter
        Write a Reply...