Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i get this error

    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 ?

  • #2
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    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.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by powerpower1; 06-12-2007 at 01:48 AM.

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes but I did that, I created the database, and i told the script to install it self there......login info is correct

  • #6
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    helloo?

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by powerpower1 View Post
    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

    Code:
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    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.

  • #9
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    _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

  • #10
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    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

  • #11
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 ?

  • #12
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is this true ???

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

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #14
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by powerpower1; 06-12-2007 at 08:59 AM.

  • #15
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •