Solved

mysql query length

Posted on 2009-05-14
3
318 Views
Last Modified: 2013-12-12
Hello
My sql quesry (a simple update statement) is about 4000 chars long.
When I do execute it, it seems mysql cannot manage it because it is too long (mysql v3.4)
is there a way to resize mysql query capacity ?

regards
update parameters set msg_chat_public = "Public chat", msg_enter_nickname = "Enter your nickname", msg_enterEmail = "Enter your email", msg_show_my_webcam = "Showme  my webcam", 
msg_left_chat = " left the chat", msg_emailSent = "An email was sent. You must confirm your account befor enter the", msg_enterNickName = "Enter your username",
 msg_was_banned_by = " was banned from chat by", msg_select_user = "Select an user on right", msg_AccountVerified = "You accouny has been successfully verified. You can login to you", 
 msg_enterPassword = "Enter password", msg_clearButton = "Clear", msg_confirmPassword = "Confirm password", msg_delete = "DELETE", 
 forgottenOK = "The password has been sent to your email.", room_friends = "Room friends", msg_male = "Male", msg_newUserRegister = "New user ? Please register here !", 
 msg_notAutenitificate = "Your account has not been activated. Please check your email.", msg_chatters_online = "Chatters", msg_text_register = "Please register !",
 msg_createRoom = "Create Room", msg_change_room = "Change room", msg_room_sexy_description = "Room  sexy: only for adults !", msg_errorSelectUser = "Select an user on right", 
 msg_sendMeMyPassword = "Send my password", msg_autoriser_prives = "Autorize private", msg_room_friends_description = "Room friends... to make new friends",
 msg_myWebcam = "My webcam", msg_connectButton = "Connected", msg_parameter_webcam = "Parameter my webcam", msg_mailSubject = "Chat activation email",
 msg_autoriser_servermsg = "Allow server messages", webmasterid = "2", msg_refuse_prive = " declined the private chat",
 msg_emailContent = "Thank you for register. To access the video chat, please click o", msg_kick = "KICKED from chat !", msg_ignore = "Ignor user", 
 msg_closeChat = "Close chat with", msg_play_music = "Background music", msg_showCamera = "show camera", msg_webcams_obligatoires = "Webcam necessary", 
 msg_entered_chat = " enetered the chat", msg_status = "Status", date = "0000-00-00", msg_please_register = "Please register", msg_decide_ignore = "You decided to ignore", 
 doesNotExistMessage = "This username does not exist !", msg_create = "CREATE", msg_voudrait_prive = " requests a private chat. Do you agree ?", msg_female = "Female", 
 msg_enterRoomName = "Enter room name", msg_enterRoomDescription = "Enter room decsription", msg_login_chat = "Login chat", msg_forgottenPassword = "Forgotten password ?", 
 msg_size_text = "Text size", forgottenKO = "This username does not exist !", msg_enter_chat = "Enter the chat", msg_adminPanel = "Admin panel", msg_wantsToTalk = " wants to talk", 
 msg_connectedUsers = "Connected users", msg_register = "Register", msg_prive = "Private", msg_private = "Private", msg_next = "Next", msg_avaibleRooms = "Avaible rooms", 
 msg_passwordMisMatch = "Password do not match", msg_wantsTalk = "Wants talk", msg_volume = "Volume", room_sexy = "Room  sexy", msg_showInfos = "Show infos",
 bannedMessage = "You have been banned.", msg_resetTalk = "RESET TALK", resgitrationKO = "Registration failed: this username or email is already used.", 
 msg_chatRoom = "Chat", msg_chat_prive = "Private chat", msg_talk = "TALK", msg_bacground_color = "Background color", msg_reset_ignored = "Reset ignored users",
 msg_ban = "BANNED from chat !", msg_play_sound = "Sound", msg_time = "Time", msg_params = "Parameters", msg_areYouSure = "Are you sure you want to delete",
 msg_hasClosedChat = " has closed the chat", msg_chat_prive_avec = "Private chat with", msg_quitButton = "Exit", msg_register_click_here = "Click HERE to register NOW", 
 msg_choose_room = "Select an room", msg_you_are_in = "You are in room", msg_sendButton = "Send", msg_couple = "Couple", msg_talkControl = "TALK CONTROL",
 msg_already_present = " already present", msg_was_kicked_by = " was kicked from chat by", msg_join = "JOIN", resgitrationOK = "registration sucess. Thanks you", date = now() 
where webmasterid=1

Open in new window

0
Comment
Question by:yarekGmail
3 Comments
 
LVL 10

Accepted Solution

by:
mahome earned 500 total points
ID: 24382494
Yes there is. Increase max_allowed_package value: http://dev.mysql.com/doc/refman/4.1/en/packet-too-large.html
0
 
LVL 8

Expert Comment

by:Bobaran98
ID: 24390874
And don't forget that with an UPDATE statement, it's a simple matter to split it into two or more statements.  You simply update some of the variables the first time and some the second time.

Whew.  That really is a massive statement!  How did you end up with something so long?  Is this something that runs frequently?  It looks like maybe it's writing configuration settings, which I guess wouldn't happen all that often.

Still.  Wow. :-)
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 24395067
I've created an ORM that auto generates the queries based on the data a client requested. I just emailed a developer a query he generated that included over 300 fields and 50 joins. And its response time was still quick!

Updates may have different limitations but I'd be surprised its so small. My ORM also automatically creates updates and I've never seen an error log related to this issue.

Your probem maybe the age of your MySql. Current version is 5.1.

I don't thing its the packet size. The default is well more than 4K

What is the actual error you get?
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Complex MySQL Query 2 33
Split wordpress loop 35 56
Moving from Mcrypt to OpenSSL 18 46
Wordpress Cron - Send XML Data to external server FTP 3 23
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

828 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