Click to See Complete Forum and Search --> : storing video using mysql


daed17
09-07-2003, 07:54 PM
how can I use php to store video in mysql?

What bandwidth issues and response issues are there associated with this method?

pyro
09-07-2003, 09:34 PM
You won't be able to store the actual video in mySQL, but rather, store the video somewhere else on your server, and just store the path in the database.

daed17
09-08-2003, 06:49 PM
well that is what I am doing now, I was just hoping mysql had a means of storing binary data.

Thanks for your help.

brendandonhue
09-08-2003, 07:52 PM
Nope-the database just stores information on that data. In case this was what you were thinking-even if you stored the video in a database, it would not save bandwidth or quicken response times.

daed17
10-27-2003, 08:46 PM
I did find this.... quite interesting...

http://www.phpbuilder.com/columns/florian19991014.php3

sumon_ruet
07-07-2005, 07:10 AM
Is there any possible way to store mp3 file (>2MB) to mysql, as binary data.
I tried, but couldnot succeed , but succeeded for about less than 2MB

daed17
07-07-2005, 10:41 AM
what version of mysql are you using?

BuezaWebDev
06-01-2006, 08:56 AM
Storing mp3s as binary data on MySQL is a good idea actually. You won't have to deal with file system permission errors, like I did with my host. My host wouldn't allow me to delete folders because I originally stored mp3s on the file system in a folder with their userID as the folder name. My host allowed me to create

Also, if you save the path in the DB and the mp3 file on the file system, and you want to delete it off the server, then you have to delete it in the DB or update a column that says that mp3 is inactive and then delete it from the file system. If you uploaded the mp3 file as a BLOB in the DB, then you would only need to do 1 query and voila.

I used MySQL 4.0.26.

bokeh
06-01-2006, 09:32 AM
The file system is for storing files and the database is for storing data. Try not to confuse the two. Storing mp3s as binary data on MySQL is a good idea actually. You won't have to deal with file system permission errors, like I did with my host.Rubbish! The files now need the webserver, php and mysql all involved in any transaction. The files are also unavailable to any application which could otherwise have accessed them natively. Your recommendation to do this is based on a configuration issue with your own hosting package, and is certainly not based on a "good idea".

NogDog
06-01-2006, 09:44 AM
Hmmm...one of those threads that won't rest in peace: original post in 2003, a couple replies in 2005, now more in 2006 - let's check back in a couple of years to see how many more replies show up. :)

bokeh
06-01-2006, 09:48 AM
Blimey, I didn't realise the person above me had dug this one out of the archive.

BuezaWebDev
06-01-2006, 02:53 PM
It's binary data. Data belongs in a database.

bokeh
06-01-2006, 03:04 PM
How many MP3 players are there on the market that use a MySQL database for file storage?

BuezaWebDev
06-01-2006, 03:08 PM
Hehe, I was researching how MySpace and mp3.com handle their mp3s.

jonra
06-01-2006, 04:44 PM
It's binary data. Data belongs in a database.
Not really... Storing files of that size in the DB is an awful, awful idea IMO. You're needlessly weighing down your system by storing files anywhere but on the web server. What is the advantage? Like someone said, if it's a server-config issue with your host maybe you have an argument - but I cannot find any value in bogging down your DB simply so you can store files within the DB itself as binary data.

chazzy
06-01-2006, 05:03 PM
then again, bueza is probably one of those blokes who thinks that when you put something into a database, it doesn't change in size.

storing binary data is never an acceptable practice for a database. it does have some uses (easier to backup, easier to maintain control/ownership) but it also suffers from a lot of problems (performance issues for one thing). If you need to control who can access things at levels beyond the file system, then fine. Items such as documents containing social security numbers, death identification, etc, fine, keep those in the database as you could lose a lot of money if they got out. storing mp3's that you don't want everyone to get, not so much critical.

daed17
06-02-2006, 12:41 AM
WOW! When I asked this back in 2003, I never dreamed it would still be alive today.

For my 2 cents, I was doing research and benchtesting back then due and really storing it on a hard drive and or in a db as binary/blog information you are going to get about the same performance. Each has thier advantages and disadvantages.