Web Hosting Talk







View Full Version : Urgent help needed with PHP


canz
04-30-2003, 09:09 PM
We are getting this error message since our dns propergated can anyone with msn please contact me to help fix it, we are a small business and we depend on out site working....
lynnstoor@hotmail.com
here's the error....

Warning: Access denied for user: 'nobody@localhost' (Using password: NO) in /home/canz/public_html/gallery/includes/sql.php on line 29

Warning: MySQL Connection Failed: Access denied for user: 'nobody@localhost' (Using password: NO) in /home/canz/public_html/gallery/includes/sql.php on line 29

Warning: MySQL: A link to the server could not be established in /home/canz/public_html/gallery/includes/sql.php on line 29
Database ERROR!

sasha
04-30-2003, 09:25 PM
There must be some config file somewhere and has credetnials (username and pass) for the database. There is something wrong with those credentials.

canz
04-30-2003, 09:56 PM
Sasha, I would kiss anything you asked right now.... thank you so much you are definaetly a lifesaver....

:D :D :D :D :D :D :D

I'm a happy camper.....

Oh dear just tring it further.... put in horse in the keyword, I get this message which I think is the same ' if I refresh the page the results show.... any more ideas... message below

Warning: Access denied for user: 'nobody@localhost' (Using password: NO) in /home/canz/public_html/gallery/includes/sql.php on line 29

Warning: MySQL Connection Failed: Access denied for user: 'nobody@localhost' (Using password: NO) in /home/canz/public_html/gallery/includes/sql.php on line 29

Warning: MySQL: A link to the server could not be established in /home/canz/public_html/gallery/includes/sql.php on line 29
Database ERROR!

Joe Bonanno
04-30-2003, 10:02 PM
canz - see my response to your post in the main web hosting forum.

CreativeLogic
04-30-2003, 10:12 PM
If you havent figured this out yet...

The sql.php file in your /public_html/gallery/includes/ folder MUST be edited. It looks as though you have Cpanel from the directory structure. You must go into CPanel and create a mysql user... Then you must edit your sql.php file... Once you create a user it will be canz_nameyoupicked unless you really dont have CPanel... Then use that password that you use for that name... You must also add that user to the database you are trying to connect to in CPanel. If you need any assistance in doing any of this I will be willing to help you out... Ill do it for you if you'd like...

- Amos

HostSonic
04-30-2003, 11:45 PM
Not sure, but.......

If you are using CPanel, then the database could have simply LOST its permissions. I see this about once per month. Have your host or admin grant permissions on this database again.

OR

The DB table could be hosed. Have your host run the Fix MySQL feature in their WebHost Manager interface for the database in question.

canz
05-01-2003, 12:30 AM
Amos
I have private messaged you for help....

our old website used to have a pleskdesk and the new one has a control panel, I don't understand php at all, about the most I can do is read thru and find some particular phase.... so if you ask me to do something, please be sure to explain it like you are explaining it to a 5 year old.

Lynny

erfg1
11-30-2004, 11:17 PM
I have the same problem, how do a I type in a username and password etc. to make it work? Do I need to make another .PHP file? Please someone help me or gimme a code that'll clear it up.
Please and Thank You.

Burhan
12-01-2004, 05:08 AM
When you don't specify a username for PHP (to connect with MySQL), it defaults to the username that the Apache process is running as (normally nobody).

Of course there is no user called "nobody" in MySQL, which is why you are getting these errors. To fix them, simply edit the sql.php file, and put the correct username, password and database information.

If you are using cpanel, please realize that your database and MySQL usernames are all prefixed with your login_. So if your login is jim453, and you create a MySQL user db, your actual user name for MySQL is jim453_db.

In the MySQL administration section of cpanel (not phpmyadmin), it will tell you sample php code that you can use to connect to MySQL, just copy the username and database information from there (of course, put the password in your sql.php file).

JasonHC
12-01-2004, 07:34 AM
Here is another hint: If you use cpanel make sure you attach a user to the database you use. Many people just create a database and a username / pass but forget to attach the user to the DB :)