?
Solved

What format or data type are images stored in MySQL tables

Posted on 2013-06-28
5
Medium Priority
?
436 Views
Last Modified: 2013-06-28
HI Experts

Can anyone tell me how to convert a jpeg image into some sort of text, that I can then copy and paste into an "SQL insert" or MySQL insert using the GUI?

The reason for this question, is I'd rather use some sort of application to do this, and was hoping there might be an online one to do this.

Any help/direction on either of these questions would be much aprectiated

Thanks
0
Comment
Question by:georgehowell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Expert Comment

by:sriramiyer
ID: 39284593
I believe it is not a wise idea to convert image to text and store it in a MySQL record.  pl. think over is it absolutely needed to do like that?
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 750 total points
ID: 39284832
Storing image in a database is a really, really, REALLY BAD IDEA.  However if you want to go that route then you will need to use a blob data type, and pre-process with PHP.  

This outlines how to do it, and points out why it is a bad idea:

http://www.phpriot.com/articles/images-in-mysql
Cd&
0
 

Author Comment

by:georgehowell
ID: 39284923
thanks Cobol for the link.. I'm reading it right now

there's only 6 product thumbnails on the whole site, so it's minimal data.  

Does anyone know if there's any online conversion or downloads to change a jpg to "blob" data-type ?

cheers
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 750 total points
ID: 39284924
I agree with the other comments posted, BTW.

The thing that comes to mind first when reading this is to MIME encode the image and store the result.  It will be all "plain text" (no binary data).  Of course, you need to MIME *de*-code the image once you yank it out of the database.  All this is highly inefficient and will slow down whatever process it is you're trying to do.
0
 

Author Comment

by:georgehowell
ID: 39285001
thanks gents for your help
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question