Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cannot select DB.


  • abc12345
    Member

    @abc12345

    I would like to try bbPress, but cannot get past the “Cannot select DB.” error message. What am I doing wrong? Here is what I have done…

    1. Downloaded and am successfully running MySQL 5.0.26 server on Mac OS X 10.4.8.

    2. Added a database called “testbb” to the mysql server (this is working because I can access this database through the mysql commandline in Terminal and in CocoaMySQL).

    3. Turned on php (version 4.4.1) in the httpd.conf file.

    4. Turned on the apache webserver running on my computer.

    5. Downloaded the bbPress folder and put it in my webserver directory.

    6. Changed the config-sample.php file to config.php.

    7. Modified the config.php file. I changed the database name to testbb, changed the username to root, added the appropriate password, and changed the URL domain to “http://localhost/~myusername” and the URL path to “/bbpress/” because I did not change the folder’s name. It is still “bbpress”.

    When I try to access the install.php file, I type in “http://localhost/~myusername/bbpress/bb-admin/install.php” into my browser. This successfully brings up the following error message: “Cannot select DB.”

    What am I doing wrong? Why can’t it access the database, when I can access it through the commandline with the same username and password?

Viewing 10 replies - 1 through 10 (of 10 total)

  • n22
    Member

    @n22

    i have the same problem!!!!!!!!!!!!!!!

    someone can help????

    The domain should be http://localhost and the path should be /~myusername/bbpress/ but that shouldn’t stop the database connection.

    Do you know if you have PHP’s mysqli extension loaded (as opposed to the normal mysql)? If you do, try copying bb-includes/db.php to bb-includes/db-mysqli.php to overwrite that later file (it seems to be out of date).

    Please let me knw if that helps or not.


    abc12345
    Member

    @abc12345

    Dear mdawaffe,

    I changed the domain and path like you said. I do not know what the mysqli extension that you are talking about is, so I doubt I have installed it.

    But, just in case, I followed your advice for replacing the mysqli.php file with the db.php file. In other words, I removed bb-includes/db-mysqli.php for safekeeping. I made a duplicate of bb-includes/db.php and renamed the duplicate bb-includes/db-mysqli.php.

    However, I still get the error “Cannot select DB.”

    Any other ideas?


    abc12345
    Member

    @abc12345

    When I did the same setup on another computer, I was able to successfully install bbpress! Finally, I got it to work. I just do not know what was different. I guess I will have to go back and see why the first system would not allow it to install properly.


    abc12345
    Member

    @abc12345

    THE PROBLEM: When running the install.php file, you get a “Cannot select DB.” error. On the Mac OS X 10.4.x intstallation, php works, mysql works, but php cannot access mysql databases.

    THE SOLUTION: Change the line

    define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    to

    define(‘BBDB_HOST’, ‘localhost:/tmp/mysql.sock’); // 99% chance you won’t need to change this value

    Then it works. There are other solutions to this problem, but this is the simplest and does not change the configuration of your system. It seems like mysql.sock has changed directories in one of the Tiger (10.4) updates.

    I hope this helps someone.

    abc112345,

    That’s a great tip, thanks! And I’m glad you got it working.


    bskiba
    Member

    @bskiba

    I am in the same camp. SuSE linux server, copied code up and keep on getting “Cannot Select DB”.

    define(‘BBDB_NAME’, ‘mas_ed’); // The name of the database

    define(‘BBDB_USER’, ‘root’); // Your MySQL username

    define(‘BBDB_PASSWORD’, ‘**thePassword**’); // …and password

    define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    Tried other DB names (began with bbpress as per sample).

    Are there any other directory rights or other things that need to be set?

    to run a script to convert phpbb2 data to bbpress i had to add add this handler to the .htaccess folder in the root of my site:

    AddHandler application/x-httpd-php5 .php

    That got the script running, but then I was unable to access my bbpress install. I’d receive:

    Cannot select DB

    So I took the “AddHandler application/x-httpd-php5 .php” out and it seems to work perfectly.

    Phew!

    Does that mean that bbpress doesn’t work with php5?

    cheers!

    Adam Teale

    I use php5+mysql 4.1.22 on a Mac,

    also get message Cannot select DB.

    I cannot insall and use the bbpress!?

    Have you tried abc’s fix? You’re sure you have the right details?

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar