Thai Miller
Thai Miller

Reputation: 11

turning blob file into a image file

im working with sakila DB and trying to turn THE blob file in there to an image file. how can I do it?

Upvotes: 0

Views: 40

Answers (1)

Akina
Akina

Reputation: 42834

SELECT picture 
FROM staff 
LIMIT 1    -- or WHERE staff_id = 1 (or 2)
INTO DUMPFILE 'C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads\\picture.png';

Check secure_file_priv system variable previously.

  • If its value is non-empty (and contains the path to some directory) then the output file path must be equal to this directory.
  • If its value is empty string than the path may be any.
  • If it is set to NULL or to a value which is not existing directory then you cannot save the output to file - create specified directory or reconfigure server.

Upvotes: 1

Related Questions