Russ Posted May 7, 2006 Posted May 7, 2006 Trying to understans how databases work. If I create a database to use with an application on my site, I presume that information is stored in the database by application. Where is the database physically located? I presume that is on a file somewhere on my site. Is that correct? Quote
TweezerMan Posted May 7, 2006 Posted May 7, 2006 Your databases are stored on the same server your account is on, but they are in a directory that is not accessible by you. (They are stored outside of your /home/cpanel_username directory.) Quote
stevevan Posted May 7, 2006 Posted May 7, 2006 Meaning you cannot access it via ftp, for example, but you can always use phpMyAdmin or cPanel. Quote
Russ Posted May 7, 2006 Author Posted May 7, 2006 Thanks. I have Gallery 2 installed on my site. I know it uses a database, but I also know that the images file (photos) reside is a file in my root. I presume therefore, that the database is not used by G2 to store the image files. Can files be stored in a database, or is it just for information that is organized and stiored in a database? Thanks the help, and patience. :-) Quote
TweezerMan Posted May 8, 2006 Posted May 8, 2006 Images can be stored in a database (in a BLOB or BINARY type field), but they usually aren't. Image data stored in a database would have to be written to a temporary file before it could be displayed in a browser because <img> tags require real file names on the server. Continually having to create and delete temporary files on the server to display images would be a lot slower than just serving the image file directly from the server. Also, storing the image data in the database would greatly increase its size for little benefit. Quote
Russ Posted May 8, 2006 Author Posted May 8, 2006 Thanks, David. I appreciate your patience with my newbie questuions today. Just curious, what are the G2 database used for then. If this is a complicated question, I understand..."Very complicated" would suffice. :-) Russ Quote
TweezerMan Posted May 8, 2006 Posted May 8, 2006 Generally, the database is used to store 1) information about your specific Gallery installation, and 2) information about your pictures and their organization. I don't currently have an installation of Gallery to look at, but I do have a Coppermine one. Information about your installation would include things such as the base URL of your photo gallery, the name of your gallery, authorized users and what permissions they have to do various things, how thumbnails are generated (or if), etc. Any settings that you can configure within the application will usually be stored in the database somewhere. Information about your pictures would include things such as the path and file name of the picture, the file size, the width and height, the number of times it has been viewed, its title and/or caption, which album it belongs to, comments and/or votes on the picture etc. You can browse your Gallery database with phpMyAdmin and see what exactly it's keeping track of if you really want to know the details. Hope this helps... Quote
Russ Posted May 8, 2006 Author Posted May 8, 2006 Yes, David, that is very helpful. Thanks, again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.