How to save pictures in MySQL
Question by JKAUSHALYA
I want to save pictures(mostly JPEG) to MySQL database. I saw most people say save pictures elsewhere and add link to table. It is the most efficient way. But i need to encrypt my pictures and want to set user privileges. So how can i do this. Please can anyone help me.
I’m using a C client program to connect to the MySQL.
Answer by genobis
Not a good idea, but if you really have to do it this way, use BLOBs (a data type).
Answer by Starx
Yes, do not insert pictures to the database table. It reduces manageability heavility. Also, when the database increases, the performance is reduced significantly. Let DBMS manage data and let File Management System manage files.
Better, save the pictures on a table and then later only retrieve the images from a folder, once a valid user is found.