Warning: mysql_connect()

Reply

Join Date: Nov 2009
Posts: 3
Reputation: Espanhol is an unknown quantity at this point 
Solved Threads: 0
Espanhol Espanhol is offline Offline
Newbie Poster

Warning: mysql_connect()

 
0
  #1
17 Days Ago
  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.

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?
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 11
Reputation: kolibrizas is an unknown quantity at this point 
Solved Threads: 1
kolibrizas's Avatar
kolibrizas kolibrizas is offline Offline
Newbie Poster
 
0
  #2
17 Days Ago
That error means, that with the data provided
  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
  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
  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).
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
0
  #3
17 Days Ago
You need to replace 'your_username' and 'your_password' with the username and password for the MySQL database.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: Espanhol is an unknown quantity at this point 
Solved Threads: 0
Espanhol Espanhol is offline Offline
Newbie Poster
 
0
  #4
16 Days Ago
thanks, it's working now, i had the wrong database in. xD
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 50
Reputation: cakka is an unknown quantity at this point 
Solved Threads: 1
cakka's Avatar
cakka cakka is offline Offline
Junior Poster in Training
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC