Non AMP
Sky Blues Talk
  • Home
  • Forums
  • General Discussion
  • Technical Support / Computing / Gaming
This is a mobile optimized page that loads fast, if you want to load the real page, click this text.

anyone understand php and mysql error (1 Viewer)

  • Thread starter jon92
  • Start date Mar 22, 2013
Forums New posts
J

jon92

New Member
  • Mar 22, 2013
  • #1
Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in /home/me/public_html/config.php on line 2 Warning: mysql_select_db(): Access denied for user 'www-data'@'localhost' (using password: NO) in /home/changj/public_html/config.php on line 3 Warning: mysql_select_db(): A link to the server could not be established in /home/changj/public_html/config.php on line 3

im trying to code the register form for a project im working on and coming across this error, i take it that its something to do with the php not connecting with the mysql databases.

any one have any ideas?
 

Nick

Administrator
  • Mar 22, 2013
  • #2
Looks like the DB username / password is wrong...
 
J

jon92

New Member
  • Mar 22, 2013
  • #3
Nick said:
Looks like the DB username / password is wrong...
Click to expand...


mysql_connect("localhost","root","Would i insert the password here"); <<<< would the password go here
mysql_select_db("tut");

this is the config file im using is the php correct
 

Nick

Administrator
  • Mar 22, 2013
  • #4
Yep you would need to put the credentials in for your DB and the db name.
 
J

jon92

New Member
  • Mar 22, 2013
  • #5
Nick said:
Yep you would need to put the credentials in for your DB and the db name.
Click to expand...

sorry nick, im confused do you mean my user name and password for the database
 

Nick

Administrator
  • Mar 22, 2013
  • #6
Yep.

Sack your tutor / lecturer too

http://www.w3schools.com/php/php_mysql_connect.asp
 
J

jon92

New Member
  • Mar 22, 2013
  • #7
Nick said:
Yep.

Sack your tutor / lecturer too

http://www.w3schools.com/php/php_mysql_connect.asp
Click to expand...

mate they actually dont teach anything for the money their on
 
J

jon92

New Member
  • Mar 22, 2013
  • #8
nick do you know if i should keep it as localhost or change it?
 

Nick

Administrator
  • Mar 22, 2013
  • #9
If your db is on the same server it will be localhost usually
 
S

SkyblueBazza

Well-Known Member
  • Mar 22, 2013
  • #10
It looks like a case of >>>DB+BS=WTF??? To me
 
J

jon92

New Member
  • Mar 22, 2013
  • #11
aw rite yeah its already on the server
 
J

jon92

New Member
  • Mar 22, 2013
  • #12
Nick said:
If your db is on the same server it will be localhost usually
Click to expand...

one more question nick in the php code that i posted before where it says host, what do i put here is it the web url, or my database name?
 

Nick

Administrator
  • Mar 22, 2013
  • #13
It is the host of the database, your host should be able to tell you what to put in.
 
J

jon92

New Member
  • Mar 22, 2013
  • #14
sorted that, but now when i press register theres a problem with my register.php file
 
You must log in or register to reply here.

Users who are viewing this thread

Total: 2 (members: 0, guests: 2)
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email
  • Home
  • Forums
  • General Discussion
  • Technical Support / Computing / Gaming
  • Default Style
  • Contact us
  • Terms and rules
  • Privacy policy
  • Help
  • Home
Community platform by XenForo® © 2010-2021 XenForo Ltd.
Menu
Log in

Register

  • Home
  • Forums
    • New posts
    • Search forums
  • What's new
    • New posts
    • Latest activity
  • Members
    • Current visitors
  • Donate to the Season Ticket Fund
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?