944,120 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 749
  • PHP RSS
Nov 6th, 2009
0

Warning: mysql_connect()

Expand Post »
PHP Syntax (Toggle Plain Text)
  1. <?
  2. $conn = mysql_connect("localhost", "your_username","your_password") or die(mysql_error());
  3. mysql_select_db('your_database', $conn) or die(mysql_error());
  4. ?>

this is the code i have on database.php, when i run register page i get a erro.

Quote ...
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_username'@'localhost' (using password: YES) in /home/a4595523/public_html/database.php on line 2
Access denied for user 'your_username'@'localhost' (using password: YES)
what should i do / change?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Espanhol is offline Offline
3 posts
since Nov 2009
Nov 6th, 2009
0
Re: Warning: mysql_connect()
That error means, that with the data provided
PHP Syntax (Toggle Plain Text)
  1. "localhost", "your_username","your_password"
you are not able to connect to a database. I do strongly think, that you specially changed the data for us not to see it, but if you really wrote
PHP Syntax (Toggle Plain Text)
  1. "localhost", "your_username","your_password"
then, you should use the real data, which would be able to connect you to your database. So, if
PHP Syntax (Toggle Plain Text)
  1. "localhost", "your_username","your_password"
is NOT the data, you are connecting with, make sure you spelled it correctly or whether such user exists on your database(if not - create one).
Reputation Points: 22
Solved Threads: 1
Light Poster
kolibrizas is offline Offline
45 posts
since May 2009
Nov 6th, 2009
0
Re: Warning: mysql_connect()
You need to replace 'your_username' and 'your_password' with the username and password for the MySQL database.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Nov 7th, 2009
0
Re: Warning: mysql_connect()
thanks, it's working now, i had the wrong database in. xD
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Espanhol is offline Offline
3 posts
since Nov 2009
Nov 8th, 2009
-1
Re: Warning: mysql_connect()
cool....
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
cakka is offline Offline
65 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP Sessions
Next Thread in PHP Forum Timeline: Select Menu Declaration in PHP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC