3

I am trying to store an image using BLOB data type in my filed in MYSQL database but when I hit Apply button, it gives me the following error:

ERROR 1105: Parameter of prepared statement which is set through mysql_send_long_data() is longer than 'max_long_data_size' bytes

I will very much appreciate any inputs.

1
  • 2
    It's generally not a good solution to store images directly in the database. Why would you do this ? Commented Dec 16, 2012 at 3:43

2 Answers 2

1

in xampp that 'my'(configuration file) location is "xampp\mysql\bin\" see in bin if you get that file there. and you try to use longblob instead of blob. longblob can store more data than blob.

edit: you can store image path (ie: ../image1.jpg) in database instead of storing image into database. storing image in database may cause problem and even its not impossible to crash database.

Sign up to request clarification or add additional context in comments.

1 Comment

thts sounds like a good idea.let me try it. I hope it doesnt give me size issues
1

The default value for max_long_data_size is 1048576 - is your picture bigger than that? If it is, you'll want to increase the value in your /etc/my.cnf file.

2 Comments

Where is this /etc/my.cnf file? I am fairly new to this so I would appreciate your help.
I am using MYSQL, so can you please direct me on how to access the file you mentioned and how you can increase the size?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.