I try to store a video file into database using MySQL, But i don't known how do store video file into database. I try following query but it didn't work.
CREATE TABLE GAME (
GAME_ID INTEGER NOT NULL PRIMARY KEY,
GAME_NAME VARCHAR (20),
VIDEO LONGBLOB );
INSERT INTO GAME VALUES(3, "Termonator2",
LOAD_FILE("C:\Users\Public\Videos\Sample Videos"));
Please give me any reference or hint.
Any help is appreciated.
Of course you can. But database including MySQL is not good at storing unstructured data like pictures, video, mp3, etc. If you just store a few small files ,it's OK, but if you want to scale out to store a lot of files, you should chose another way.
If you want to store videos in a SQL Server database, you can use VARBINARY(MAX) (which is a way of saying you want to store a binary large object). You can also enable FILESTREAM access so that SQL Server can save your video as a file on the file system.
Storing videos and images directly in database is not a viable solution. The ideal way is to store images and videos in CDN and save that file path in DB. Advantage of storing in CDNs, data will be served from edge server's(cached) rather than from source.
Best Answer. Oracle NoSQL Database provides a Large Object interface that is intended to be used to read and write large objects such as audio or video data.
I would advise you to store the video file in a file directory, and only store the filename in your MySQL database.
This way, you can keep a light database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With