View Full Version : i get this error

06-12-2007, 01:54 AM
my script is not connecting to my database, i get this error

Warning: mysql() [function.mysql]: Access denied for user 'apache'@'localhost' (using password: NO)

when i installed the script it did build the info in the database, but its not connecting to it when you run the script......please keep in mined that the script is encoded, so i cant change the code, this script works perfect on other peoples websites, im just the only one having a problem, but why is it going to use 'apache'@'localhost' .....it should use root.....any idea how to fix it ?

06-12-2007, 02:18 AM
Check the install documents for setting up the database. There should be an entry for creating the database and a user/pass to access the database. Don't use root under any circumstances.

A confuguration file is probably created during the install process which takes the database name, host server, username and password that you give. You have to ensure that there's a database on the host with a user/pass that has access to the db before running the install.

06-12-2007, 02:43 AM
the script did the database tables, so the info is correct......conf file contains the correct info

its something to do with php5 .......script worked fine on php4

06-12-2007, 02:51 AM
Just because the database and tables were created doesn't mean you have a login to access the database. Generally you need to manually create a login and then provide that login information to the scripts install/config file. Are you running this on your own server at home? If so then check your mysql manager tool and make sure the login you provided in the script config file exists.

06-12-2007, 02:54 AM
yes but I did that, I created the database, and i told the script to install it self there......login info is correct

06-12-2007, 04:02 AM

06-12-2007, 04:10 AM
yes but I did that, I created the database, and i told the script to install it self there......login info is correct

Obviously its not since you got this error

Access denied for user 'apache'@'localhost' (using password: NO)
Thats saying that there is no user with username apache. Also learn to be patient. We are here to help everyone not just you so waiting a mere two hours before saying something juvenile like "hello?" isn't how things work around here. As we've been telling you should double check your user name and password. I'm guessing its probably still root with no password set.

mr e
06-12-2007, 04:11 AM
Well the error you gave us usually means the username/password is wrong for the given database, so unless you can provide more information I can't see how anyone could help any more than they have.

You say that the tables have already been created, does that mean you filled out a config file beforehand and ran the install and it created the tables, or did you manually create them and still need to edit the config file?

Are you on a home server? Or on a hosts server? Are you sure you have the right username/password?

The more details you give us the better we'll be able to try and figure out what's going wrong.

06-12-2007, 04:35 AM
_Aerospace_Eng_ sorry about that, i just need this fix so bad ...anyhow this is what happeend

1- I created the database with user and pass

2- I ran install and it asked me for the database info

3- everything got installed and the script stored database info in a conf.xml file

now, script is installed successfuly, database is poupulated ......but script is not connecting to it

the script got the correct login info, if wouldnt had pupulated it if the info wasnt correct

mr e
06-12-2007, 07:38 AM
Do you have PHP4 or 5?

Because you say it's stored in an XML file, and if the script is trying to use PHP5 XML functions and you have PHP4, it wouldn't be able to parse the XML to retrieve the database info and would end up using unpopulated (empty) variables to try to connect to the database, thus giving you your MySQL error

Might be a stretch, but you never know :)

06-12-2007, 09:19 AM
you are right about populating........but im using php5, but the script was made for php4

is it true that the "ftp and cpanel and database" should have same login info for it to fix the problem ?

06-12-2007, 09:32 AM
is this true ???

The problem is that your PHP version was upgraded to 5.0.4. PHP5 deals with things differently than PHP4 does.

06-12-2007, 09:40 AM
You say you have Cpanel so login to Cpanel, click on mysql databases. It will show you your current databases. Below that it will say Users in database. It should say what privileges you have. If it doesn't show users in database then you have no user setup for that database. You will need to create new user and password. After that you will go to the part that says Add Users to Database. Select the username you just created and the database you want to grant permssions to for that user. Check the box that says ALL and then click Add User to Database.

06-12-2007, 09:56 AM
dude thats not the problem, we went over this so many time now

everthing is there, this is an odd thing.....database is PERFECT, and the login info for everthing eles is PERFECT

this is a compatibility issue.......when i move the files back to php4 ...it works fine, but i need it to be on this server witch its using php5

06-12-2007, 10:01 AM
Dude from the error you posted that appeared to be the problem. Oh and dude since you haven't posted any of your code we can't tell you if your PHP is using something not supported in PHP 5. So dude we aren't psychic, we were just trying to rule things out.

06-12-2007, 10:05 AM
script is too big, its about 200 files.....and most of it is encoded with zend, i can post the conf file, but thats not going to help

this issue is corrected somehow from mysql......not from the script

06-12-2007, 10:10 AM
how can i move this to the mysql category ??