Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of my friends asked some asp developer to make online application where user can upload files also. jpg, doc, pdf and all these files are saved in SQL database as flat file. Now, my friend asked me to do everything in PHP and he want to migrate all the data which he has in SQL database to MySQL database. I can do it. text can be migrated easily but the files which are saved in SQL database can be migrated to MySQL as flat files. Is it possible?

share|improve this question

migrated from Mar 23 '13 at 16:56

This question came from our site for professional and enthusiast programmers.

Which "SQL database" are you talking about? Basically every relational DBMS nowadays is a "SQL database". SQL is only query language, not a specific DBMS product. – a_horse_with_no_name Nov 19 '13 at 19:22
I might be missing something but why could you not us PHP and the current database you have? Is there a reason you want to move to MySQL? – WindRaven Feb 17 '14 at 21:07

According to this you should be able to store files in a blob or text field. I don't actually work with mysql so I googled "mysql datatypes".

share|improve this answer

Yes, files embedded in a database (e.g. Word, Excel, etc) can be extracted and written to the file system (flat files). How you do it depends on your database technology (what kind of "SQL Server" are you using, but it is not especially hard.

But, do you actually want the files in the file system outside of SQL Server? Or did I misunderstand your comment?

We have gone back and forth on where to store files that are related to database content. Some are embedded in the SQL Server (Microsoft SQL Server) and some are on the file system. (Sigh.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.