Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Apache, PHP and mySQL

  1. #1
    Senior Member
    Join Date
    Oct 2004
    Posts
    187

    Apache, PHP and mySQL

    Hello all,
    I'm just going in Apache, PHP and mySQL. For the moment I'm and absolute newbie with this things and I know that the question I'm going to ask is stupid but I don't understand how to get it run.
    So here we go.
    I have apache installed on c:\apache
    My PHP is on c:\PHP
    And the mySQL server is on c:\MySql

    Everything is well configured(I think) I want to install things like phpBB, nucleus, mambo. I start their installation.php files. They are running and I always get the error "couldn't connect to the database" or "the password for the database is wrong".
    I understand what that means but I don't understand how to show the way(the root) to the database? I even don't know in what folder it is. I thought that each program as php... create its own database - that is why I don't understand for what database it is a question?
    And about the password I'm also curious I'm sure that I'm writing the right one.
    Remember, all I\'m offering is the truth, nothing more.

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    I want to install things like phpBB, nucleus, mambo. I start their installation.php files.
    You should start by reading the README and/or INSTALL files. They usually tell you what you should do and how to setup mysql.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    There is so much information in these readmes that I'm confused.
    I went in google and tryed to find info for creating database for phpBB.
    I found the following web site:
    http://www.devside.net/web/server/windows/phpBB

    I think it is very well explained. I did what is written there but I got the following things

    Warning: mysql_connect(): Access denied for user 'phpBB2user'@'localhost' (using password: YES) in c:\apache\apache\htdocs\db\mysql4.php on line 48

    Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in c:\apache\apache\htdocs\db\mysql4.php on line 330

    Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in c:\apache\apache\htdocs\db\mysql4.php on line 331
    phpBB : Critical Error

    Could not connect to the database
    I did everything as it is written? Where is my mistake?
    Remember, all I\'m offering is the truth, nothing more.

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Posts
    469
    I don't know about doing all of this on a windows box, but the error you're getting is that you don't have permissions to do what you're trying to do. I'm going to venture to guess that the operation that is causing this is a connect operation? Does the user phpBB2user exist in mysql? If not you need to add that user and give it access.

  5. #5
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    I did the following:
    Setup phpBB's MySQL database and user

    * Access the MySQL prompt...
    o C:\www\mysql\bin> mysql -u root -p
    o [note that if password for MySQL user 'root' has not been set; when prompted for the password, leave line blank and hit Enter]
    * Create database 'phpBB2' (phpBB's main database, which will hold all tables)...
    o mysql> CREATE DATABASE phpBB2;
    * Create secured account with user 'phpBB2user' and password 'dbpassword' (secured account -- only accessible from 'localhost', access permitted only to database 'phpBB2', only needed privileges granted)...
    o mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP ON phpBB2.* TO 'phpBB2user'@'localhost' IDENTIFIED BY 'dbpassword';
    o [note password 'dbpassword' -- substitute in selected alternative]
    o [note that DROP is only required for database restores, and ALTER is only required for certain modules and future upgrades]
    o mysql> FLUSH PRIVILEGES;
    o mysql> quit;
    Remember, all I\'m offering is the truth, nothing more.

  6. #6
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Looks like MySQL is setup.. You can check by running mysql -u phpBB2user -p dbpassword.
    But:
    Warning: mysql_connect(): Access denied for user 'phpBB2user'@'localhost' (using password: YES) in c:\apache\apache\htdocs\db\mysql4.php on line 48
    Sounds like the password you set isn't setup correctly in phpBB.
    Go to http://localhost/forums/install/install.php and check the password and click on Start Install.

    Oh. And I highly recommend changing that username/password to something else
    But you need to make sure both mysql and phpbb use the same username/password combination.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  7. #7
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    Don't worry for the password! I will format my hard disk in few days and this is only for testing and the security for the moment is not a question. When I have everything done then I will start thinking for it

    I made a new database.
    This time I got the same error message. Then I went to http://localhost/forum/contrib/dbinformer.php

    Here is what I got:
    What you entered
    Database Type: MySQL 4.x
    Database Server Hostname / DSN: localhost
    Your Database Name: test1
    Database Username: test1user
    Database Password: ********
    Connection to database
    You have not established a connection to MySQL 4.x.
    ERROR:

    Your database was found.
    Config file
    The database has not been successfully connected to so no config file has been generated.
    What I'm wondering is: your database was found and then It couldn't establish connection to mySQL4.x
    Remember, all I\'m offering is the truth, nothing more.

  8. #8
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Did you do the GRANT for this test1user? Did you GRANT {..} ON test1.* {...}?
    Did you FLUSH PRIVILEGES after that?
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  9. #9
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    Yes Sir! I did!

    mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP ON phpBB2.* TO 'test1user'@'localhost' IDENTIFIED BY '*******';
    mysql> FLUSH PRIVILEGES;
    mysql> quit;
    Remember, all I\'m offering is the truth, nothing more.

  10. #10
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    No you didn't

    What you entered
    Database Type: MySQL 4.x
    Database Server Hostname / DSN: localhost
    Your Database Name: test1
    Database Username: test1user
    Database Password: ********
    Connection to database
    You have not established a connection to MySQL 4.x.
    ERROR:

    Your database was found.
    Config file
    The database has not been successfully connected to so no config file has been generated.
    mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP ON phpBB2.* TO 'test1user'@'localhost' IDENTIFIED BY '*******';
    Oliver's Law:
    Experience is something you don't get until just after you need it.

Posting Permissions

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