4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: unviedamour on January 31, 2006, 10:35:35 PM

Title: "Could not select database" ?? Please help!
Post by: unviedamour on January 31, 2006, 10:35:35 PM
Up until a week or two ago, I had a gallery up on my website, belbin-agosto.net, with something like 1500 pictures. My site began recieving a lot of traffic, so my web host moved me to a worse server until the traffic subsided. When this happened, my MySQL database was lost.
They recently moved me back to the better server, but the database is still gone. However, all of my files are intact, 4images is still installed, all the images are still on the server, etc.

I would like to get it up and running again without losing any of the files or information - many of the photos are saved on my old hard drive which I no longer use (and am not quite sure where it is).

So I created a new database today with the same name as before, and made myself a user of the database with the same username and password as before. However, when I try to go to the gallery (belbin-agosto.net/4images) I get this error:

DB Error: Could not select database (belbin2_4images).

What can I do to fix this? As I said above, I would like to get the gallery back up and running without much hassle. I have gotten several emails from visitors to my site inquiring about the gallery, and I want to get it back up for them as soon as possible!

Any help you could give would be greatly appreciated. Thanks!
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on January 31, 2006, 10:44:58 PM
First, welcome to the forum.

Second, this issue has been covered in the FAQ. Please visit that section before posting. ;)
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on January 31, 2006, 10:56:39 PM
Thanks. :)

And, sorry for my ignorance, but where? I looked in the FAQ section earlier and I found the question about the config.php file, and I went through it and did what it says...am I missing something?
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on January 31, 2006, 10:59:29 PM
In that case, you might want to use the forum's search engine.

Here's a related topic for instance :

http://www.4homepages.de/forum/index.php?topic=9276.msg43803#msg43803
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on January 31, 2006, 11:33:40 PM
I think I found the problem - there are no tables in my database. Is there any way I can get them without having to reinstall the whole thing?
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 01, 2006, 12:22:39 AM
Quote

Is there any way I can get them without having to reinstall the whole thing?


Absolutely. In your data/database/mysql folder, there's a file named : mysql_default.sql and you can apply the whole SQL file into your phpmyadmin by simply importing the file itself. ;)

Note: The file's content creates a prefix with : 4images_. When you'll create your config.php (if it isn't already created), make sure this is the prefix that's been set. Otherwise, more errors will come along. ;)
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 01, 2006, 01:54:11 AM
I've imported the file, but I'm still getting the error message. Here's a screenshot of my phpMyAdmin page:

(http://i21.photobucket.com/albums/b279/unviedamour/screenshot.jpg)

Are those all the files I need? Here's the end of my config file:

Quote
$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "belbin2_4images";
$db_user = "belbin2_*****";
$db_password = "******";

$table_prefix = "4images_";

define("4IMAGES_ACTIVE", 1);

?>

Except, of course, my username and password are there instead of the asteriks. ;)

I'm really at a loss here. Thanks for all your help so far. :)
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 01, 2006, 01:59:44 AM
Well, if your config.php file is stable like :

Quote

$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "belbin2_4images";
$db_user = "belbin2_*****";
$db_password = "******";

$table_prefix = "4images_";

define("4IMAGES_ACTIVE", 1);


(Disgarding your privacy of username and password. ;)), then everything should be fine - even after your screenshot of phpmyadmin. Simply make sure to delete the PHP installation file of 4images from your server before running 4images and you should be able to load it successfully (store front and ACP). ;)
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 01, 2006, 02:09:04 AM
So my config file is fine and I have all the right files?

What's my next step? Delete the file (what's the name of the file, btw?) ?

And I'm sorry for so many stupid questions, but
Quote
delete the PHP installation file of 4images from your server before running 4images
when you say "running 4images", I'm not quite sure what you mean. :oops: What do I have to load to make it work?

Again, sorry for so many questions!
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 01, 2006, 02:13:36 AM
Since you seem to have fully installed 4images, delete install.php file from your FTP / CPanel. Then, go on your web browser and execute your gallery like this :

http://www.yourgallerydomain.com/yourgalleryname/index.php

From there, you should be able to see your storefront.

Then, if you wish to go to your Admin Control Panel page, execute the login page like this :

http://www.yourgallerydomain.com/yourgalleryname/admin/index.php

(Hope this will be added to the FAQ - this is unbelievable !!!)
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 01, 2006, 02:27:35 AM
Would you believe it's still not working? I can't even find the install file, I must have deleted it when I installed it originally.

I didn't reinstall it when I made the new database - is that the problem? but if I reinstall it, will I lose all of my files and pictures?

I'm so frustrated right now! The tech support guy made it sound so easy - "The images will still be present, however. You will likely need to re-create the database for the image gallery."
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 01, 2006, 02:58:25 AM
Simply try a fresh new installation over a test folder to see if you see the same results. If so, then it is clairly you did something wrong along the process.
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 01, 2006, 03:06:44 AM
Thanks, I'll try that and let you know the results. :) And if the new installation works out, then we try to see what went wrong with the original?
Title: Re: "Could not select database" ?? Please help!
Post by: V@no on February 01, 2006, 03:12:20 AM
Is there any way I can get them without having to reinstall the whole thing?
If you dont have any backups for your database then the answer is - NO.
Even if your image files are intact, the information about them is gone (based on your original post), so it means you will need basicaly start over.

I know it will be very paintfull but I'd suggest you follow these steps:
1) since it seems you already created the database and all needed tables, you dont need instal.php anymore, now go to ACP (Admin Control Panel) -> Settings and check that everything is the way you want to be.

2) Since information about your categories is gone, you will need recreate all categories manualy. But, there is a little trick - you have all your images already placed in data/media/XX/ folders (where XX is a number - category id) So, even though you recreate all categories from ACP, it does not mean that the images will be placed in the correct categories, because category IDs might not be the same as they were on your "old" site...so, you will need move the images into proper XX folders...well, ofcourse if its easier you could simply rename the folders the images in to the correct name as the new category id...like do it one category at a time: create category, find out it's id, find the files that are belong to that category and rename the folder they are in...

3) once you recreated all categories and move all files into correct folders, you will need run "check new images" in ACP and add all images into the database...

Paintfull, but perhaps this will help you to do database backups periodicaly ;)

Good luck.
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 01, 2006, 04:09:09 AM
I was afraid of that.

Ugh, I can't belive they did this to me! This is going to take up so much extra time that I don't have. :evil:

Thanks for all your help. :)
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 08, 2006, 12:28:13 AM
How do I get to the ACP? I can't access my gallery at all: http://belbin-agosto.net/4images
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 08, 2006, 12:36:06 AM
See this topic :

http://www.4homepages.de/forum/index.php?topic=9276.0
Title: Re: "Could not select database" ?? Please help!
Post by: unviedamour on February 08, 2006, 12:45:28 AM
I don't really see where it says how to connect to the ACP when I can't access the gallery.

I haven't reinstalled 4images yet. Should I do that now?
Title: Re: "Could not select database" ?? Please help!
Post by: TheOracle on February 08, 2006, 12:52:20 AM
The way to access ACP is the same way to access your gallery since your database is being accessed from the same file which is : config.php - located on your root path of your gallery. If you're experiencing problems accessing your current mySQL Database and that you're absolutely sure you entered the data correctly, then perhaps you should report this problem to your web hosting party. ;)
Title: Re: "Could not select database" ?? Please help!
Post by: V@no on February 08, 2006, 12:58:42 AM
http://www.4homepages.de/forum/index.php?topic=3319.0