Storing files in a database?

I have always been told, not to store images and files directly into the tables. For instance in blob-fields. But no one has ever told me the arguments for not doing so.

Why is it considered not wise to store files in blob-fields in the database

Posted On: Thursday 25th of October 2012 11:17:23 PM Total Views:  221
View Complete with Replies

Related Messages:

Extracting data/text from pdf and storing into a database   (95 Views)
Hi all,I was wondering if there was any type of code or which language would be best to extract data/text from multiple PDF files and storing the data/text into databases. Basically, the data extracted would be 6 letters followed by string of text detailing those 6 letters followed by a number.
Compressing large strings before storing   (166 Views)
I've had a look around and found this thread which helps a little, but I would like some further advice. I am storing strings of varying length upto but no larger 23,708 characters. Without taking CPU cycles into consideration, and assuming, over time, there will be a lot of rows containing large strings, would it be worth gzipping the larger strings before insertion Any advice would be great.
Restoring table to table   (212 Views)
how can i restore TableX in dbX to tableY in dbY using command prompt (all datas in tableX to tableY) (i can do using Restore table command )
Restoring mysqldump to new database   (93 Views)
I am trying to migrate some forums to updated software, so I did a mysql dump of the database and then tryed to restore it into a backup database for use during the upgrade, and it seems as if the restoration just stalls out. I let the command run over night, and it just stalled, did not fill the new database at all, and never got prompted with a error in SSH. Any way to check to make sure everything went properly with the mysqldump
Problems restoring MySQL DB   (91 Views)
I'm trying to dump and restore a MySQL DB I tried the following (for restoring) : Quote: gunzip < my_DB_BACKUP.sql.gz | mysql -u root my_DB_name And I got the following error: Quote: ERROR 1005 at line 11: Can't create table './dpplb_development_DB/table_A.frm' (errno: 150) The DB that I'm tryning to restore (for argument sake) have several tables, table_A, table_B, table_C...,table_Y, table_Z such that table_Y depends (i.e there are foreign key constraints) on table_Z existing...table_A depends on table_B before they can be created. My question is there anyway for me to force MySQL to restore the tables in the opposite order (i.e. table_Z...table_A) as it appears that that is the problem.
Trouble restoring backup from mysqldump   (220 Views)
, I have a script that runs every night to backup our databases. It uses the following command: mysqldump -e -c -uroot -p --all-databases The password is correct, and it dumps. The output looks like this: -- -- Current Database: `hqpc5` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hqpc5` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */; USE `hqpc5`; -- -- Table structure for table `tbl_creatures` -- DROP TABLE IF EXISTS `tbl_creatures`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tbl_creatures` ( `creature_id` int(11) NOT NULL AUTO_INCREMENT, `soul_energy` int(11) NOT NULL, `name` varchar(50) COLLATE latin1_general_ci NOT NULL, .... .... And loads of data follows. As we have multiple DBs on the server, I go into the text file and take all the text from one Current Database comment to the next, and put it in a seperate file. Then I use phpmyadmin's import function, and I get an error. It looks like the problem is that it's trying to create a table with a foreign key contraint before the table the constraint refers to is created. Am I doing the dump part or the restore part wrong
Question - Manual edit of database backup prior to restoring   (222 Views)
I am not too experienced with MYSQL so the answer maybe obvious but it's causing me to pull my hair out. I may also have answered my own question but I would like confirmation that doing what seems logical is OK and that there are no hidden problems being created. A website I manage needed sorting out so I backed up the MYSQL DB and downloaded the complete site to my HD. I then deleted everything and created a new DB, same name etc etc. When I try to restore the DB it fails because a DB of that name already exists. There doesn't seem to be a way to restore a DB from the back up if the DB doesn't already exist, or if it does it is not obvious to me. looking at the first few lines of the back up I see the following... CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `DB4ME`; It seems logical that if I delete the line CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; That the first instruction is then USE `DB4ME`; My question is therefore is that correct or is there more to it This is the first section of the back data... -- phpMyAdmin SQL Dump -- version -- PHP URL -- -- Host: localhost:3306 -- Generation Time: May 28, 2008 at 09:21 AM -- Server version: 4.1.20 -- PHP Version: 5.0.5 -- -- Database: `DB4ME` -- CREATE DATABASE `DB4ME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `DB4ME`; -- -------------------------------------------------------- If anyone could clarify my logic or otherwise offer me way round this I'd be most grateful.
A decent utility for backing up and restoring large mysql databases?   (139 Views)
I have tried multiple utilities to backup and restore mysql databases... I say large in my header but they are not really. They are just to big to restore with phpMyAdmin. I can't tell you how frustrating it always is when I try to do this... there will always be some kind of error when I try to do it. I have tried various utilties and nothing seems to do the job properly. You know those days when everything you try fails Yes I know I can break them up but surely there must be something that can do this for me on the fly reliably
SQL date storing   (94 Views)
Question : I need to store date only in '' format, in my case i don't need year. For example i want to have table seasons defined : Code: season_code from to firstq 02.04. 01.06. secq 02.06. 28.08. thirq 29.08. 01.10. So i can handle this from and to fields as date.
Problem Backing Up and Restoring Databases with pgAdmin 3 (1.10.0)   (68 Views)
I'm having an issue with backing up and restoring databases with pgAdmin 3 (1.10.0). The problem is with how pgAdmin is converting every "serial" type column to it's "int" equivalent. For example the following table: Code: CREATE TABLE users_ranks ( id serial NOT NULL, rank character varying(10) NOT NULL, CONSTRAINT users_ranks_pkey PRIMARY KEY (id) ) Is converted to this after the dumb/restore: Code: CREATE TABLE users_ranks ( id integer NOT NULL DEFAULT nextval(('public.users_ranks_id_seq'::text)::regclass), rank character varying(10) NOT NULL, CONSTRAINT users_ranks_pkey PRIMARY KEY (id) ) In the past I've been backing up the databases as SQL files, editing the backup SQL to blow away the the DEFAULT crap and change the columns back to their orignal "serial" type. This is, of course, a giant pain in my ***. Is there something I'm doing wrong or is this a bug
What is the data type for storing long text with HTML tags in pgsql?   (82 Views)
, What is the data type for storing long text with HTML tags in pgsql I need to store the HTML formated template like texts in the database. Thank you in advance. With
Most efficient way of storing data from multiple accounts   (87 Views)
As part of a system I am putting together I need to allow users to create thier own accounts on my servers. Each user can create their own account, and then have their users register for it. Each account needs it data seperate from the others, a member registered for one account should not be able to view another account and a username registered with one account should still be available to the other accounts. The ways I have been looking at are: 1. Create a new database for every account created so that all users are kept in seperate databases. 2. Have one table for users, one for topics, one for posts etc and then associate each row within this table with the relevent account. So for example a user could register with the forum with the ID 4, so their user entry would be Userid: 234 Username: xxxx Password: xxxx Forumid: 4 Then when a new member registers with any account I simply check that there is not another user with the same account ID and username. Indexes on relevent fields in this system could help speed up huge tables. I expect to quickly have 20,000 plus accounts (and in theory it could go up to hundreds of thousands). I guess my question is which of these methods is better from a speed point of view once we get a large number of accounts and users. Also, are there restrictions on the number of fields in a table that could cause problems Using MySQL by the way, on an Apache server.
Error when restoring a database   (199 Views)
, I backed up a table about a month ago and now I am trying to restore it. For some reasons, I got this error while restoring this table. ERROR 1064 at line 6945692: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' My mysql version is version: 4.0.20a-nt Can some please tells me what is wrong here so I can correct it and restore the complete table
Requesting help on storing user generated content   (96 Views)
I'm wondering if there's any info out there on storing user generated and customized content. For example, if it was a single web page, and the user set some of the css, some of the html, and a bunch of content. Initially, it sounds like a many to many tables situation, but honestly, it's overwhelming me having cels for each css property, etc. But then, storing the whole lot in one table or even one row makes it a nightmare for updating. Also, in situations like this are new tables generated for users Hopefully there's some inspirational info out there
Importing CSV files to a table using SQLYog   (98 Views)
I have two columns in my csv file but when I import the file, both columns go into one field, seperated by a commar leaving the second field with null values. I need to import two columns from the csv file into two fields in SQLYog. Can anyone tell me what I'm doing wrong
Is there a way to generate sql insert statement from directory of files?   (180 Views)
I'm trying to make something like this: Code: (NULL, 'SeaBattle', 'gameboy', 'Gameboy', '22', 'TheSmartass', '37', 'Unsorted', '13', '1', '0', '480', '432', '', '2009-03-29 19:30:38', 'English', '', '', 'SeaBattle'), all the file names are like or something.... They are just sitting in a directory. Can something generate this statement for me inserting all the file names I mean I am ok with doing mass find and replace to get rid of .zip and if i must I will put space into sql statement... But so far the only way I have found to do this is with "send to clipboard as name" and then tons of mass find and replace as well as manual data entry on each line. Seeing how I was stupid and wasn't remote backing up my database since getting new hard drive installed a month ago I now have countless hours of data entry ahead unless there is solution.
db backup of files   (95 Views)
instead of doing a mysqldump can I just backup the physical files in /var/lib/mysql if it crashes, I just copy and replace the folder
Access mdb-files   (50 Views)
. I have received an Access-database from a customer, which I need to read, but I do not own Microsoft Access. Is there any free tool available which can read Access-files
Using magic numbers or storing redundant data?   (112 Views)
Say I have a couple of columns in a database table, named BizType and AccountType. To satisfy business rules, BizType needs to be either a "Parent" business or a "Sub" business. Second, AccountType needs to be either "Business", "Personal" or "Both". BizType My first inclination was to make 1 represent "Parent" and 2 represent "Sub", and then store a series of 1s and 2s in the data column. However, after I looked how the database table looked using these "magic numbers", I was afraid it would cause another developer a bit of a headache in trying to determine what these numbers represented, even though I did put the representation in the table comments. So I changed all the 1s to Parent and the 2s to Sub and put a constraint on the table so that BizType must equal Parent or Sub. However, I still wasn't happy with how the table worked, mainly as a result of storing redundant data. I'm having trouble though justifying creating a second table that stored Parent and Sub with IDs of 1 and 2 and storing those IDs as foreign keys in my original table as these aren't likely to ever change. Also, although another developer is more likely to realize these are foreign keys and find the related table, I dont see this situation as significantly more beneficial than using magic numbers, as these values are unlikely to change. Account Type I had the same problem with this column. I was going to assign 1 to Business, 2 to Personal and 3 to Both. I didn't like using magic numbers so I decided to just stored Business, Personal and Both. But now I don't like storing redundant data, but cannot justify creating a second table to store the three values, as they are not likely to change because of business rules. Also, the future developers might still look at the table and say "What do these numbers stand for" I don't see creating a second table storing the three values as being much more beneficial than using magic numbers. If anyone has ever come across a similar situation and could give me some direction/advice on what might be an appropriate way of solving this problem that would be spectacular. I know the cardinal rule of databases is to not store redundant data, but I wonder if this might be one of those exceptions, as magic numbers are frowned upon as well, although more so in programming. Thank you all for you time! Travis Rhynard
Connect remote JSP files with Local MySQL Database?   (75 Views)
I use dreamweaver 8.0. I have my jsp files on the remote server. I have my local computer connected to this server. I have my MySQL database on my computer. I want to know how to connect the remote JSP files with the database Where should be the ODBC-drivers Please reply