Contents
Can we store videos in MySQL database?
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. LOAD_FILE(“C:\Users\Public\Videos\Sample Videos”) is a DIRECTORY.
Can you store audio files in MySQL?
Dan Craven answered the first half of your question, and I agree that it’s better to store the path to the file rather than the file itself in your database. MySQL is fully capable of storing the full MP3 file as a BLOB, but can suffer some performance problems along the way.
Can we store images and videos in MySQL?
Yes, you can store images in the database, but it’s not advisable in my opinion, and it’s not general practice. A general practice is to store images in directories on the file system and store references to the images in the database.
Is it possible to store pictures, sounds, videos in SQL database?
Although its generally not recommended to store images inside the Database, its better to store path of the image. Nevethless the images can be stored in the database by using a longblob datatype. Check out this example from MySql forums. Not the answer you’re looking for?
What’s the best way to store files in MySQL?
At the time of writing, MySQL does not. Store them as external files. Then save the path in a varchar field. Putting large binary blobs into a relational database is generally very inefficient – they only use up space and slow things down as caches are filled are unusable. And there’s nothing to be gained – the blobs themselves cannot be searched.
How to store audio files in a blob?
To store the audio files in a BLOB (binary large object) column as part of a database table. To use a VARCHAR column to store relative (or absolute) file paths and names. The former will no doubt involve a performance overhead on your database, whilst the second approach means that the media is outside of the database’s schema.
Where do I store images in MySQL database?
My recommendation is, as Max has suggested, to store on the filesystem and store a path in the db as varchar. This has the advantage of not having to deal with the files in the db.