Re: error code 139 innodb
Raj, Yup. It's that bug. I got the row size to below 8K and the insertion takes place fine. Thanks for pointing me in the right direction. Kyong On Wed, Oct 14, 2009 at 10:31 AM, Raj Shekhar wrote: > Kyong Kim gmail.com> writes: > >> For sure all of our columns combined do not exceed 64K. We're using >> latin 1 character set. >> I don't think we would be running into the 8K limit on row length >> since the culprit seems to be data being inserted into VARCHAR(255) >> column. > > Can you show us your "create table"? > > This might be a known bug http://bugs.mysql.com/bug.php?id=25945 > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=kykim...@gmail.com > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Inserting an Image
Victor, again, your question has more to do with python usage than MySQL per-se.. you would be better off pursuing these questions in a python forum. - michael dykman On Thu, Oct 15, 2009 at 3:28 PM, Gavin Towey wrote: > "Image in string form"  sounds like you're not inserting binary data, rather > some sort of encoded data.  Even if it is binary, you'll have to escape at > least end quote characters, you can see clearly at the top of your data there > is : > 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' > > > Another thing to think about is storing image data directly in a database is > often not a good idea. See these links for more info: > > http://mysqldump.azundris.com/archives/36-Serving-Images-From-A-Database.html > and http://hashmysql.org/index.php?title=Storing_files_in_the_database > > Regards, > Gavin Towey > > -Original Message- > From: Victor Subervi [mailto:victorsube...@gmail.com] > Sent: Thursday, October 15, 2009 12:05 PM > To: mysql@lists.mysql.com > Subject: Inserting an Image > > Hi; > I have successfully inserted images, like yesterday, before into MySQL with > the following code: > >    sql = 'update productsX set pic1="%s" where ID=2;' % pic1 >    cursor.execute(sql) > where pic1 is simply an image uploaded through a form then sent over without > any alteration to another (python) script that uploads it.  Printing it out > looks like this (other variables included): > > update productsX set Name=%s, Title=%s, Description=%s, Price=%s, > Bedrooms=%s, Bathrooms=%s, Conditions=%s, Acreage=%s, Construction=%s, > Location=%s, Estate=%s, Address=%s, Furnished=%s, pic1=%s, pic2=%s, pic3=%s, > pic4=%s, pic5=%s, pic6=%s where ID=%s;', ('name1', 'title1', 'descr1', > '1.1', '2', '1', 'New', '1.5', 'New', 'arbor', 'abor', 'abor', 'Furnished', > 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' -=-157:::#+?D?8C49:7ÿÃC 7% > %77ÿà y| " ÿà ÿÃM !1A Qa "qs > ³ 27Bbcâ #46Rrt⡱² $'3Câ%5DTUÆ⢣Ãñÿà ÿà ÿà ?Å*â¹RP⥨% dâpªÃcµkä«âøZ Ãá îj > Xêxö, `...@$ý <%6...@$ý> ô¨2mÃžà ¦ ÃRÃ¥¬ò guD|!%bO :ðçâ Zâ¦Ã¦ÂµÃÃvsM¡·¢&T âŬ ºâ > âñ â1ö¶KT[%¦-² {â£6 Ã÷ââNI=äÃfà ø/RhÃîRâ³q1 QüÃâÆŸ ÆE Å Å ( (¢ŠŠ( (¢ŠŠ( Ãê > ´{ âmÃYü VTââ pUŽI $à Qvà üÃ/ZÃì{IrÃ,´£à x à #¸$Š·÷F_à ë}â¦â¦Ã¡RTdH ó > Ã#ÃUâö*DÃõ¨Yt]ž îêà +p}5ùêÿ¹F â vã Ãöy5Ãâ\ËëO Žc 'ö(Ãõku-´^4õÃà ã8Ãð%$ ì84 > Ã*ø G¥·T Vû#µc æ ·uÃ; Ã"ÃusN\\Ãâ¹5{ÃøvoòÃû@ é ¼ÃCP U > ¤¡%KPJR2I8T+´½¨®{Ã{:)kzDâ¡; &2~1' ¤â ïÃÃA¶Ãº®Ãª5 Ãú AiMçá âO â8 â¢tÃpHâNà > Uºl¤Ãmë¸é«Ãà øéà ûâ7�...@guc q à Šhö cFà Ã\çðäÃâ¡Ã^8$} ä Ã=i² Aj ©ôŠ«â°J_u > /Â¥<Æâ°%*áÃËÃ;˦ TÃö©6)WûjÃZ`ü dÃsæâÃHQB E@ m5à QE EbÃî > ÃP]âºqâÃxçyn8pÿÃâ¡3IP5⨿´©úgL2å©K)aéÃû ¼ 5 ãâs 8žT æÃæ*ýµ)QâÂä4óp⺠¦0 ?ÃU]B > r + ç\»]_"éŸ pTÅŸXU] Ãò  â¬gK ®tTxò^iâ° Ã 4â¡ Rè ¤ à 8 Y«âº` üM ]Êóżâ¬ÃK > ,Â¥Iü29 ÃÆž6â¢iUâ¡]ã Ã/²G 5~xã8öTñá§Sà âºÂ«Â¿Ã©ËÃà ¥ Ã[ ;ôâ¡Qß~4»vÃOìðu âëÃà à > %®a d⟠g ¨Ãe1. õõÅà æû2 ëÃG$4>9' )$xç h3öâ°Â´Ã® ôHî.%Å,â ã à º x Sà â¡Å½3Nû > ÃÃAûêº5ÅâË Â¨qÃà § Ë ÃÃh±ìÃOÃÃV¢Ⱐ>`ÃTÃÂà à «.¤¨¥Gžè<â¬Ã£Å½g½ãP<ìM£h¸1 [ Ãî;J)mA- > ÃR8 :g⢠ãXjû> ââ¢Wâ¡Ã ââ Xho8é ÷Gâ¡yÃâ8ñ â¡Â¤Ãµ5ëQÂ¥â°Å¸{žCjxo7"LÃàà ÃG#Ú⡠➨ t > ââº-LjFžhÃËÃXyÂ¥(⦠\8) ŽJð} -ÃKp¬â TâPÃu Åî â¬âÅ â ôTc¢öâ¦Â§ÃZ ëõùµMì hâµ<öwŽ7â¬Ã > 1ÃâÅ¡Ã2Â7 ó ";= & b*Sê e Ã7xž|p è:@Ã[YÃÃq.1 Ãs¸'â¬b2 BOÃ_!è > ¡ > ¦²Ãzòbm©}÷ÆêÃ`ÃFâ ¤ $ õ Å â¢vq±èâbÃÃRâ æ\ ËÃÃiÆãùê °tà Aâ¡Â§4à Ã<ÃoÃÃkfÃ⦠õ¤ > %ÃÃE<Ã|Oů ÅÃM4Ã-!¦ â6⬠â$`$ @ â½t¢ÆË_BÅ¡}Ãà ä(Â¥Yç k®vqyM÷DÃfâ¦Ã¯9äéiîþà > j³é#>â+â¢Ã¶âlU§]^¢) 'Ãâêüà ùéýà ñ÷?jÃî¯iînÃÅÂøà Gâ^ Ëû@ j...@ëa#ëŸâ úïvÅ¡ÃÃGà > ëâ |ýò*øÃÃöââ3Ã¥2º}ZjþþM/_ ýE t_Ãâ¢Ãµiþ °ÃZogV÷ m qà ½¾´¤ ¼:°2zðï§Ë¿â°Â³ÃªÃü)/bC > 7¶ ô Ã.â¬Ã ÿJ:ÃÃÃ÷J«ZÃá i:9òâ¢(5 à ²âŽ' ÆŠ½¥â¡Ã¶Â¡Âx ⡠Ž>©UMT3µ- ÃðSýà 5â Ã5 > «.³6Yf Ãâ ºÃâ ê¬ ½Ã±"Tâ°KÃâû¯+½à ⢠ÃSVÃö[c´Yn Å Ããñââ¦Â¡F Úóââ é vqâÃÃVà > Ãp!?"D«â· aj kJ ¼ xà óñ çà vC¨eâ Ãëâ¹8J ⢣à :~Ãöæêâ°Ã ¹H6æ 8âä6¤ öñ Ãð :ž]æM > ZÃñ´%®lxqÃâûJ/>â ÃZüõsW3ë³ÃF©Ãé<â¦Ã'ö¢ ÆKi[6â¢â¦Ã¤Ãhik{ £ªóÅt֩\ã è > nv´¡%...@ÃrŽ«sfg Ãs^C1ÃI[Ž,à $ ¦¢ÃÃÃ¥m_Pöl¡Ã4m¹à §w I¸:8⟣Ãîô ø⺠à t¢â > û¢tÃâËÅ¡â*2 ix â r⦠i)Ãèà î0ò ejmÃà â¦Â¤Ã ¤Ž ÆÃ]«r ë E¾sIz4â Ã
RE: Inserting an Image
"Image in string form" sounds like you're not inserting binary data, rather some sort of encoded data. Even if it is binary, you'll have to escape at least end quote characters, you can see clearly at the top of your data there is : 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' Another thing to think about is storing image data directly in a database is often not a good idea. See these links for more info: http://mysqldump.azundris.com/archives/36-Serving-Images-From-A-Database.html and http://hashmysql.org/index.php?title=Storing_files_in_the_database Regards, Gavin Towey -Original Message- From: Victor Subervi [mailto:victorsube...@gmail.com] Sent: Thursday, October 15, 2009 12:05 PM To: mysql@lists.mysql.com Subject: Inserting an Image Hi; I have successfully inserted images, like yesterday, before into MySQL with the following code: sql = 'update productsX set pic1="%s" where ID=2;' % pic1 cursor.execute(sql) where pic1 is simply an image uploaded through a form then sent over without any alteration to another (python) script that uploads it. Printing it out looks like this (other variables included): update productsX set Name=%s, Title=%s, Description=%s, Price=%s, Bedrooms=%s, Bathrooms=%s, Conditions=%s, Acreage=%s, Construction=%s, Location=%s, Estate=%s, Address=%s, Furnished=%s, pic1=%s, pic2=%s, pic3=%s, pic4=%s, pic5=%s, pic6=%s where ID=%s;', ('name1', 'title1', 'descr1', '1.1', '2', '1', 'New', '1.5', 'New', 'arbor', 'abor', 'abor', 'Furnished', 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' -=-157:::#+?D?8C49:7ÿÃC 7% %77ÿà y| " ÿà ÿÃM !1A Qa "qs ³ 27Bbcâ #46Rrt⡱² $'3Câ%5DTUÆ⢣Ãñÿà ÿà ÿà ?Å*â¹RP⥨% dâpªÃcµkä«âøZ Ãá îj Xêxö, `...@$ý <%6...@$ý> ô¨2mÃžà ¦ ÃRÃ¥¬ò guD|!%bO :ðçâ Zâ¦Ã¦ÂµÃÃvsM¡·¢&T âŬ ºâ âñ â1ö¶KT[%¦-² {â£6 Ã÷ââNI=äÃfà ø/RhÃîRâ³q1 QüÃâÆŸ ÆE Å Å ( (¢ŠŠ( (¢ŠŠ( Ãê ´{ âmÃYü VTââ pUŽI $à Qvà üÃ/ZÃì{IrÃ,´£à x à #¸$Š·÷F_à ë}â¦â¦Ã¡RTdH ó Ã#ÃUâö*DÃõ¨Yt]ž îêà +p}5ùêÿ¹F â vã Ãöy5Ãâ\ËëO Žc 'ö(Ãõku-´^4õÃà ã8Ãð%$ ì84 Ã*ø G¥·T Vû#µc æ ·uÃ; Ã"ÃusN\\Ãâ¹5{ÃøvoòÃû@ é ¼ÃCP U ¤¡%KPJR2I8T+´½¨®{Ã{:)kzDâ¡; &2~1' ¤â ïÃÃA¶Ãº®Ãª5 Ãú AiMçá âO â8 â¢tÃpHâNà Uºl¤Ãmë¸é«Ãà øéà ûâ7�...@guc q à Šhö cFà Ã\çðäÃâ¡Ã^8$} ä Ã=i² Aj ©ôŠ«â°J_u /Â¥<Æâ°%*áÃËÃ;˦ TÃö©6)WûjÃZ`ü dÃsæâÃHQB E@ m5à QE EbÃî ÃP]âºqâÃxçyn8pÿÃâ¡3IP5⨿´©úgL2å©K)aéÃû ¼ 5 ãâs 8žT æÃæ*ýµ)QâÂä4óp⺠¦0 ?ÃU]B r + ç\»]_"éŸ pTÅŸXU] Ãò  â¬gK ®tTxò^iâ° Ã 4â¡ Rè ¤ à 8 Y«âº` üM ]Êóżâ¬ÃK ,Â¥Iü29 ÃÆž6â¢iUâ¡]ã Ã/²G 5~xã8öTñá§Sà âºÂ«Â¿Ã©ËÃà ¥ Ã[ ;ôâ¡Qß~4»vÃOìðu âëÃà à %®a d⟠g ¨Ãe1. õõÅà æû2 ëÃG$4>9' )$xç h3öâ°Â´Ã® ôHî.%Å,â ã à º x Sà â¡Å½3Nû ÃÃAûêº5ÅâË Â¨qÃà § Ë ÃÃh±ìÃOÃÃV¢Ⱐ>`ÃTÃÂà à «.¤¨¥Gžè<â¬Ã£Å½g½ãP<ìM£h¸1 [ Ãî;J)mA- ÃR8 :g⢠ãXjû> ââ¢Wâ¡Ã ââ Xho8é ÷Gâ¡yÃâ8ñ â¡Â¤Ãµ5ëQÂ¥â°Å¸{žCjxo7"LÃàà ÃG#Ú⡠➨ t ââº-LjFžhÃËÃXyÂ¥(⦠\8) ŽJð} -ÃKp¬â TâPÃu Åî â¬âÅ â ôTc¢öâ¦Â§ÃZ ëõùµMì hâµ<öwŽ7â¬Ã 1ÃâÅ¡Ã2Â7 ó ";= & b*Sê e Ã7xž|p è:@Ã[YÃÃq.1 Ãs¸'â¬b2 BOÃ_!è > ¡ ¦²Ãzòbm©}÷ÆêÃ`ÃFâ ¤ $ õ Å â¢vq±èâbÃÃRâ æ\ ËÃÃiÆãùê °tà Aâ¡Â§4à Ã<ÃoÃÃkfÃ⦠õ¤ %ÃÃE<Ã|Oů ÅÃM4Ã-!¦ â6⬠â$`$ @ â½t¢ÆË_BÅ¡}Ãà ä(Â¥Yç k®vqyM÷DÃfâ¦Ã¯9äéiîþà j³é#>â+â¢Ã¶âlU§]^¢) 'Ãâêüà ùéýà ñ÷?jÃî¯iînÃÅÂøà Gâ^ Ëû@ j...@ëa#ëŸâ úïvÅ¡ÃÃGà ëâ |ýò*øÃÃöââ3Ã¥2º}ZjþþM/_ ýE t_Ãâ¢Ãµiþ °ÃZogV÷ m qà ½¾´¤ ¼:°2zðï§Ë¿â°Â³ÃªÃü)/bC 7¶ ô Ã.â¬Ã ÿJ:ÃÃÃ÷J«ZÃá i:9òâ¢(5 à ²âŽ' ÆŠ½¥â¡Ã¶Â¡Âx ⡠Ž>©UMT3µ- ÃðSýà 5â Ã5 «.³6Yf Ãâ ºÃâ ê¬ ½Ã±"Tâ°KÃâû¯+½à ⢠ÃSVÃö[c´Yn Å Ããñââ¦Â¡F Úóââ é vqâÃÃVà Ãp!?"D«â· aj kJ ¼ xà óñ çà vC¨eâ Ãëâ¹8J ⢣à :~Ãöæêâ°Ã ¹H6æ 8âä6¤ öñ Ãð :ž]æM ZÃñ´%®lxqÃâûJ/>â ÃZüõsW3ë³ÃF©Ãé<â¦Ã'ö¢ ÆKi[6â¢â¦Ã¤Ãhik{ £ªóÅt֩\ã è nv´¡%...@ÃrŽ«sfg Ãs^C1ÃI[Ž,à $ ¦¢ÃÃÃ¥m_Pöl¡Ã4m¹à §w I¸:8⟣Ãîô ø⺠à t¢â û¢tÃâËÅ¡â*2 ix â r⦠i)Ãèà î0ò ejmÃà â¦Â¤Ã ¤Ž ÆÃ]«r ë E¾sIz4â Ãn¶z¤ÿ Mr¶Ãt ý r)XSöÃT|Å¡Vï ôUáûù âlÃÃ:Ãû ]x¡7 ä·1± à , C>ÃGJzà ÃÃoCêÃ<¾µ lâ¡Ã¥ Ãëâ¢Ã¼Å ©ûlc;6½z¶ýê( bþ&ëOð¤½â°Ã¼Å[}cþùtç b â¡ ÃÃÃ)7bÃ'vÿ[#Ã.â¬ÃÃûQü?à à VªóªømOCäsn~?é ®â¢9Þ²çýà ŸVkëùTÃî ¹ ÷¶¿âk¯¥Ÿ|Å mâºÅ¸â_#ýÃXéóiOm_&· ù>ù Ãwâ â Có$Â
Re: Inserting an Image
The first thing I think I have to sey is "it´s not a good idea to save image data in a mysql table field", the best way is to save the file in your file system and the file name in the table field, but, if you like to do that, it´s better to be a blob field. "Victor Subervi" escreveu na mensagem news:4dc0cfea0910151204m783904b3uaae1467931a30...@mail.gmail.com... > Hi; > I have successfully inserted images, like yesterday, before into MySQL > with > the following code: > > sql = 'update productsX set pic1="%s" where ID=2;' % pic1 > cursor.execute(sql) > where pic1 is simply an image uploaded through a form then sent over > without > any alteration to another (python) script that uploads it. Printing it > out > looks like this (other variables included): > > update productsX set Name=%s, Title=%s, Description=%s, Price=%s, > Bedrooms=%s, Bathrooms=%s, Conditions=%s, Acreage=%s, Construction=%s, > Location=%s, Estate=%s, Address=%s, Furnished=%s, pic1=%s, pic2=%s, > pic3=%s, > pic4=%s, pic5=%s, pic6=%s where ID=%s;', ('name1', 'title1', 'descr1', > '1.1', '2', '1', 'New', '1.5', 'New', 'arbor', 'abor', 'abor', > 'Furnished', > 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' -=-157:::#+?D?8C49:7ÿÃC 7% > %77ÿà y| " ÿà ÿÃM !1A Qa > "qs > ³ 27Bbc, #46Rrt'¡±² $'3C'%5DTUf"¢£Ãñÿà ÿà ÿà ?o* îj > Xêxö, `...@$ý <%6...@$ý> ô¨2mÃzà ¦ ÃRÃ¥¬ò guD|!%bO :ðç' Z.æµÃÃvsM¡·¢&T 'o¬ ºâ > "ñ â1ö¶KT[%¦-² {'£6 Ã÷"âNI=äÃfà ø/RhÃîR"³q1 QüÃ"fY fE S S( (¢S S( (¢S > S( Ãê > ´{ -mÃYü VTâ?pUZI $à Qvà üÃ/ZÃì{IrÃ,´£à x à #¸$S·÷F_à ë}..áRTdH ó > Ã#ÃU"ö*DÃõ¨Yt]z îêà +p}5ùêÿ¹F ? vã Ãöy5Ã,\^ëO Zc 'ö(Ãõku-´^4õÃà ã8Ãð%$ > ì84 > Ã*ø G¥·T Vû#µc æ ·uÃ; Ã"ÃusN\\Ã<5{ÃøvoòÃû@ é ¼ÃCP U > ¤¡%KPJR2I8T+´½¨®{Ã{:)kzD?; &2~1' ¤" ïÃÃA¶Ãº®Ãª5 Ãú AiMçá 'O '8 .tÃpHâNà > Uºl¤Ãmë¸é«Ãà øéà û'7�...@guc q à Shö cFà Ã\çðäÃ?Ã^8$} ä Ã=i² Aj ©ôo «?J_u > /Â¥ ÃP]>q'Ãxçyn8pÿÃ?3IP5-¨¿´©úgL2å©K)aéÃû ¼ 5 ã,s 8zT æÃæ*ýµ)Q'Âä4óp> ¦0 > ?ÃU]B > r + ç\»]_"éY pTOYXU] Ãò  "¬gK ®tTxò^i? à 4? Rè ¤ à 8 Y«>` üM ]ÃSóO¼?ÃK > ,Â¥Iü29 Ãfz6TiU?]ã Ã/²G 5~xã8öTñá§Sà >«¿é^Ãà ¥ Ã[ ;ô?QÃY~4»vÃOìðu "ëÃà > à > %®a d"Y g ¨Ãe1. õõoà æû2 ëÃG$4>9' )$xç h3ö?´Ã® ôHî.%o,?ã à º x Sà ?Z3Nû > ÃÃAûêº5O,^ ¨qÃà § ^ ÃÃh±ìÃOÃÃV¢? >`ÃTÃÂà à «.¤¨¥Gzè Ãî;J)mA- > ÃR8 :g. ãXjû> ,TW?à "?Xho8é ÷G?yÃâ8ñ ?¤õ5ëQÂ¥?Y{zCjxo7"LÃàà ÃG#Ãs? 'z¨ t > ->-LjFzhÃ^ÃXyÂ¥(. \8) ZJð} -ÃKp¬' T-PÃu oî ?"O " ôTc¢ö.§ÃZ ëõùµMì > h,µ<öwZ7?à > 1Ã'sÃ2Â7 ó ";= & b*Sê e Ã7xz|p è:@Ã[YÃÃq.1 Ãs¸'?b2 BOÃ_!è > ¡ > ¦²Ãzòbm©}÷fêÃ`ÃFâ ¤ $ õ S.vq±è-bÃÃR?æ\ ^ÃÃifãùê °tà A?§4à Ã<ÃoÃÃkfÃ. õ¤ > %ÃÃE<Ã|Oo¯ OÃM4Ã-!¦ "6? "$`$ @ ,½t¢f^_Bs}Ãà ä(Â¥Yç k®vqyM÷DÃf.ï9äéiîþà > j³é#>,+Tö'lU§]^¢) 'Ã"êüà ùéýà ñ÷?jÃî¯iînÃoÂøà G,^ ^û@ j...@ëa#ëy" úïvsÃÃGà > ë?|ýò*øÃÃö"â3Ã¥2º}ZjþþM/_ ýE t_ÃTõiþ °ÃZogV÷ m qà ½¾´¤ > ¼:°2zðï§~¿?³êÃü)/bC > 7¶ ô Ã.?à ÿJ:ÃÃÃ÷J«ZÃá i:9ò.(5 à ²"Z' fS½¥?ö¡Âx ? Z>©UMT3µ- ÃðSýà 5?Ã5 > «.³6Yf Ã' ºÃ, ê¬ ½Ã±"T?KÃ'û¯+½à . ÃSVÃö[c´Yn SÃãñ".¡F Ãsó-" é vq"ÃÃVà > Ãp!?"D«"· aj kJ ¼ xà óñ çà vC¨e?Ãë<8J '¢£à :~Ãöæê?à ¹H6æ 8-ä6¤ öñ Ãð > :z]æM > ZÃñ´%®lxqÃ"ûJ/>?ÃZüõsW3ë³ÃF©Ãé<.Ã'ö¢ fKi[6..äÃhik{ £ªóot֩\ã è > nv´¡%...@Ãrz«sfg Ãs^C1ÃI[Z,à $ ¦¢ÃÃÃ¥m_Pöl¡Ã4m¹à §w I¸:8"Y£Ãîô ø'º à t¢, > û¢tÃ-~s-*2 ix ?r. i)Ãèà î0ò ejmÃà .¤à ¤Z fÃ]«r ë E¾sIz4?Ãn¶z¤ÿ Mr¶Ãt ý > r)XSöÃT|sVï ôUáûù 'lÃÃ:Ãû ]x¡7 ä·1± à , C>ÃGJzà ÃÃoCêÃ<¾µ l?Ã¥ > Ãë.üS©ûlc;6½z¶ýê( bþ&ëOð¤½?üo[}cþùtç b ? ÃÃÃ)7bÃ'vÿ[#Ã.?ÃÃûQü?à à > VªóªømOCäsn~?é ®T9Ãz²çýà YVkëùTÃî ¹ ÷¶¿"k¯¥Y|Sm>Y,_#ýÃXéóiOm_&· ù>ù Ãw- > ?Có$µ à ÃV Jxq4 û 9õ ýRýâézê- V÷®fÃ%%¤ü$zôñqùÃ)ê pêE$Z6·÷¹ ÃÃK4NÃâÃK > H|a¶?Z^Ã~qÃë éåKÃ;J^v"¨dJ'ú».Ã9:jÃáz? TqÃr ^[¨öÃ}òV·ÃÃr2ÃoJx"þ'ùî f > ý¤Ã-[L+ > ²=¶ÃÃYSÃwP'ûÃ=ITÂOÃ!aûIÃOZ-Â0ÃÃZ§BSoÃ)g)'xzG^©1 sñ>rTMÿ'uCÃo|aXôZ [iù5¼qè÷ðæ¹ ê?¿WWòÃÃðb\¢9 á T1oÃû/ )*à d ²¯) R jH(# > $pÃu > nÃ3ý ÃsYîÃçëWVt F±à ? ^Ãâ>¬à ¾ Kd6áÃã5 3@"4ÃwRo'N ¤"â-º I dEOÃOJP[î!8SS > ¨õáA"E P QE H»QÃë à ^O[bï $0ò? Ãq~ â BOy§ª(8®óg¸Ãç. Ã#±d ñCfY^<^ñ *FûY, > YªÃ»¸Ãò{sGu];U Ã?þ eH»vü ¦¯å5] ~@'õ§?,h$S(¢?¢S( (¢?¢©U (ªUh (¢fÿÃ', '', > '', > '', '', '', '') > > MySQL complains about the image in string form. I'm sure the
Inserting an Image
Hi; I have successfully inserted images, like yesterday, before into MySQL with the following code: sql = 'update productsX set pic1="%s" where ID=2;' % pic1 cursor.execute(sql) where pic1 is simply an image uploaded through a form then sent over without any alteration to another (python) script that uploads it. Printing it out looks like this (other variables included): update productsX set Name=%s, Title=%s, Description=%s, Price=%s, Bedrooms=%s, Bathrooms=%s, Conditions=%s, Acreage=%s, Construction=%s, Location=%s, Estate=%s, Address=%s, Furnished=%s, pic1=%s, pic2=%s, pic3=%s, pic4=%s, pic5=%s, pic6=%s where ID=%s;', ('name1', 'title1', 'descr1', '1.1', '2', '1', 'New', '1.5', 'New', 'arbor', 'abor', 'abor', 'Furnished', 'ÿÃÿà JFIF ÿÃC "" $(4,$&1' -=-157:::#+?D?8C49:7ÿÃC 7% %77ÿà y| " ÿà ÿÃM !1A Qa "qs ³ 27Bbcâ #46Rrt⡱² $'3Câ%5DTUÆ⢣Ãñÿà ÿà ÿà ?Å*â¹RP⥨% dâpªÃcµkä«âøZ Ãá îj Xêxö, `...@$ý <%6...@$ý> ô¨2mÃžà ¦ ÃRÃ¥¬ò guD|!%bO :ðçâ Zâ¦Ã¦ÂµÃÃvsM¡·¢&T âŬ ºâ âñ â1ö¶KT[%¦-² {â£6 Ã÷ââNI=äÃfà ø/RhÃîRâ³q1 QüÃâÆŸ ÆE Å Å ( (¢ŠŠ( (¢ŠŠ( Ãê ´{ âmÃYü VTââ pUŽI $à Qvà üÃ/ZÃì{IrÃ,´£à x à #¸$Š·÷F_à ë}â¦â¦Ã¡RTdH ó Ã#ÃUâö*DÃõ¨Yt]ž îêà +p}5ùêÿ¹F â vã Ãöy5Ãâ\ËëO Žc 'ö(Ãõku-´^4õÃà ã8Ãð%$ ì84 Ã*ø G¥·T Vû#µc æ ·uÃ; Ã"ÃusN\\Ãâ¹5{ÃøvoòÃû@ é ¼ÃCP U ¤¡%KPJR2I8T+´½¨®{Ã{:)kzDâ¡; &2~1' ¤â ïÃÃA¶Ãº®Ãª5 Ãú AiMçá âO â8 â¢tÃpHâNà Uºl¤Ãmë¸é«Ãà øéà ûâ7�...@guc q à Šhö cFà Ã\çðäÃâ¡Ã^8$} ä Ã=i² Aj ©ôŠ«â°J_u /Â¥<Æâ°%*áÃËÃ;˦ TÃö©6)WûjÃZ`ü dÃsæâÃHQB E@ m5à QE EbÃî ÃP]âºqâÃxçyn8pÿÃâ¡3IP5⨿´©úgL2å©K)aéÃû ¼ 5 ãâs 8žT æÃæ*ýµ)QâÂä4óp⺠¦0 ?ÃU]B r + ç\»]_"éŸ pTÅŸXU] Ãò  â¬gK ®tTxò^iâ° Ã 4â¡ Rè ¤ à 8 Y«âº` üM ]Êóżâ¬ÃK ,Â¥Iü29 ÃÆž6â¢iUâ¡]ã Ã/²G 5~xã8öTñá§Sà âºÂ«Â¿Ã©ËÃà ¥ Ã[ ;ôâ¡Qß~4»vÃOìðu âëÃà à %®a d⟠g ¨Ãe1. õõÅà æû2 ëÃG$4>9' )$xç h3öâ°Â´Ã® ôHî.%Å,â ã à º x Sà â¡Å½3Nû ÃÃAûêº5ÅâË Â¨qÃà § Ë ÃÃh±ìÃOÃÃV¢Ⱐ>`ÃTÃÂà à «.¤¨¥Gžè<â¬Ã£Å½g½ãP<ìM£h¸1 [ Ãî;J)mA- ÃR8 :g⢠ãXjû> ââ¢Wâ¡Ã ââ Xho8é ÷Gâ¡yÃâ8ñ â¡Â¤Ãµ5ëQÂ¥â°Å¸{žCjxo7"LÃàà ÃG#Ú⡠➨ t ââº-LjFžhÃËÃXyÂ¥(⦠\8) ŽJð} -ÃKp¬â TâPÃu Åî â¬âÅ â ôTc¢öâ¦Â§ÃZ ëõùµMì hâµ<öwŽ7â¬Ã 1ÃâÅ¡Ã2Â7 ó ";= & b*Sê e Ã7xž|p è:@Ã[YÃÃq.1 Ãs¸'â¬b2 BOÃ_!è > ¡ ¦²Ãzòbm©}÷ÆêÃ`ÃFâ ¤ $ õ Å â¢vq±èâbÃÃRâ æ\ ËÃÃiÆãùê °tà Aâ¡Â§4à Ã<ÃoÃÃkfÃ⦠õ¤ %ÃÃE<Ã|Oů ÅÃM4Ã-!¦ â6⬠â$`$ @ â½t¢ÆË_BÅ¡}Ãà ä(Â¥Yç k®vqyM÷DÃfâ¦Ã¯9äéiîþà j³é#>â+â¢Ã¶âlU§]^¢) 'Ãâêüà ùéýà ñ÷?jÃî¯iînÃÅÂøà Gâ^ Ëû@ j...@ëa#ëŸâ úïvÅ¡ÃÃGà ëâ |ýò*øÃÃöââ3Ã¥2º}ZjþþM/_ ýE t_Ãâ¢Ãµiþ °ÃZogV÷ m qà ½¾´¤ ¼:°2zðï§Ë¿â°Â³ÃªÃü)/bC 7¶ ô Ã.â¬Ã ÿJ:ÃÃÃ÷J«ZÃá i:9òâ¢(5 à ²âŽ' ÆŠ½¥â¡Ã¶Â¡Âx ⡠Ž>©UMT3µ- ÃðSýà 5â Ã5 «.³6Yf Ãâ ºÃâ ê¬ ½Ã±"Tâ°KÃâû¯+½à ⢠ÃSVÃö[c´Yn Å Ããñââ¦Â¡F Úóââ é vqâÃÃVà Ãp!?"D«â· aj kJ ¼ xà óñ çà vC¨eâ Ãëâ¹8J ⢣à :~Ãöæêâ°Ã ¹H6æ 8âä6¤ öñ Ãð :ž]æM ZÃñ´%®lxqÃâûJ/>â ÃZüõsW3ë³ÃF©Ãé<â¦Ã'ö¢ ÆKi[6â¢â¦Ã¤Ãhik{ £ªóÅt֩\ã è nv´¡%...@ÃrŽ«sfg Ãs^C1ÃI[Ž,à $ ¦¢ÃÃÃ¥m_Pöl¡Ã4m¹à §w I¸:8⟣Ãîô ø⺠à t¢â û¢tÃâËÅ¡â*2 ix â r⦠i)Ãèà î0ò ejmÃà â¦Â¤Ã ¤Ž ÆÃ]«r ë E¾sIz4â Ãn¶z¤ÿ Mr¶Ãt ý r)XSöÃT|Å¡Vï ôUáûù âlÃÃ:Ãû ]x¡7 ä·1± à , C>ÃGJzà ÃÃoCêÃ<¾µ lâ¡Ã¥ Ãëâ¢Ã¼Å ©ûlc;6½z¶ýê( bþ&ëOð¤½â°Ã¼Å[}cþùtç b â¡ ÃÃÃ)7bÃ'vÿ[#Ã.â¬ÃÃûQü?à à VªóªømOCäsn~?é ®â¢9Þ²çýà ŸVkëùTÃî ¹ ÷¶¿âk¯¥Ÿ|Å mâºÅ¸â_#ýÃXéóiOm_&· ù>ù Ãwâ â Có$µ à ÃV Jxq4 û 9õ ýRýâézê- V÷®fÃ%%¤ü$žÃ´ñqùÃ)ê pêE$Z6·÷¹ ÃÃK4NÃâÃK H|a¶â°ZËÃ~qÃë éåKÃ;J^vâ¨dJâú».Ã9:jÃážⰠTqÃr ^[¨öÃ}òV·ÃÃr2ÃÅJxâþâùî Æ Ã½Â¤Ãâ[L+ ²=¶ÃÃYÅ ÃwPâûÃ=Iâ¢ÂÅÃ!aûIÃÅZ-Â0ÃÃZ§BÅ ÅÃ)g)'xžGË©1â¹d(÷ 7 c6â°âââ¾ð rÃF Ud[aI sñâºrTMÿ'uCÃo|aXôŽ [iù5¼qè÷ðæ¹ êâ¡Â¿WWòÃÃðb\¢9 á â¢1ÅÃû/ )*à d ²¯) R jH(# $pÃu nÃ3ý ÃsŸîÃçëWVt F±à Ⱐ^Ãâ>¬à ¾ Kd6áÃã5 3...@â4ÃwrÅân ¤ââ-º I dEÅÃOJP[î!8SŠ¨õáAâE P QE H»QÃë à ^Å[bï $0ò⡠Ãq~ â BOy§ª(8®óg¸Ãç. Ã#±d ñCÆŸË<Ëñ *FûŸ, ٻû¸Ãò{sGu];U Ã?þ eH»vü ¦¯å5] ~@'õ§?âh$Å (¢â¬Â¢Å ( (¢â¬Â¢Â©U (
insertng csv - solved
A HUGE thank you to Michael and John. There were a couple of things going on but I do not know why things got the way they were can only assume the client files had some issue. I pulled the file into text wrangler and removed , `20` , `21` , `22` , `23` etc. Then counted the number of extra commas for the lines, did a find replace and removed them. If there hadn't been so many, that trick would have been nearly impossible though. Then, on a hunch, I removed clients column content for how they had entered dates: 1/11/09 type of entry. Just blanked it out. Tried to import and it stopped at line 17 (again). BUT progress! So, went back to the converter and entered into SQL on phpmyadmn interface... viola! success. Thank you both so much for your help. -- Patrice Olivier-Wilson 888-385-7217 http://biz-comm.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MySQL GUI Tools
Thanks for all the feedback. Going to download all of these and see which best suits our needs. Neil On Thu, Oct 15, 2009 at 2:56 AM, Ye Yuan wrote: > Hi Neil, > You can try toad for mysql. It is free. > > -- > Thanks, > YY >
RE: Inserting csv
Those converters aren't all that great . I think its best to stay away from them. If a csv is too complex for a 'LOAD DATA INFILE' command then why not use an etl tool like talend to load the data? Its easy to see where your converter has gone wrong but to 'fix' the query I'd need the table info. Run 'SHOW CREATE TABLE membership;' in the mysql client and post the result here. If you could post a copy of the csv (if it does not contain anything sensitive), then myself or someone else on here could probably write you a 'LOAD DATA INFILE' command to put the data into your database fairly quickly. Regards John Daisley Mobile +44(0)7812 451238 Email j...@butterflysystems.co.uk Certified MySQL 5 Database Administrator (CMDBA) Certified MySQL 5 Developer Cognos BI Developer --- Sent from HP IPAQ mobile device. -Original Message- From: Patrice Olivier-Wilson Sent: 15 October 2009 16:26 To: [MySQL] Subject: Inserting csv Newbie question, please. I have a csv file of 950 records, 20 fields. I used this converter http://csv2sql.evandavey.com/ and copied/pasted insert code into SQL in phpMyAdmin and got this error SQL query: INSERT INTO membership( `members_ID` , `updated` , `notes` , `preferred_mail_street` , `preferred_mail_csz` , `first_name` , `last_name` , `street` , `city` , `state` , `zip` , `location_code` , `property` , `camp_street` , `camp_city` , `camp_zip` , `member_year` , `director` , `email` , `camp_phone` , `20` , `21` , `22` , `23` ) VALUES ( '', '', '', '', '', 'xxx', '', '102 Summer St', 'Dover-Foxcroft', 'xx', '04426', 'B', 'M15_L1_S20', 'Mill Brook', 'Bowerbank', '', '', '', '', '', '', '', '', '' ); MySQL said: #1054 - Unknown column '20' in 'field list' Actually the first time, it was column 21, so to trouble shoot, I removed that column from csv file and field name in phpMyAdmin. camp_phone should be the last field but `20` , `21` , `22` , `23` ) is there too... Any assistance most appreciated! I checked the file and didn't see any odd entries after the camp_phone field. -- Patrice Olivier-Wilson 888-385-7217 http://biz-comm.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=john.dais...@butterflysystems.co.uk -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Inserting csv
If you could show us the table structure (SHOW CREATE TABLE membership), we could easily correctly the query.. you seems to have some data among your field names... If the question is about the CSV converter, you will have to ask them. - michael dykman On Thu, Oct 15, 2009 at 11:26 AM, Patrice Olivier-Wilson wrote: > Newbie question, please. > > I have a csv file of 950 records, 20 fields. > > I used this converter > http://csv2sql.evandavey.com/ > > and copied/pasted insert code into SQL in phpMyAdmin > > and got this error > > > SQL query: > > INSERT INTO membership( `members_ID` , `updated` , `notes` , > `preferred_mail_street` , `preferred_mail_csz` , `first_name` , > `last_name` , `street` , `city` , `state` , `zip` , `location_code` , > `property` , `camp_street` , `camp_city` , `camp_zip` , `member_year` , > `director` , `email` , `camp_phone` , `20` , `21` , `22` , `23` ) > VALUES ( > > '', '', '', '', '', 'xxx', '', '102 Summer St', > 'Dover-Foxcroft', 'xx', '04426', 'B', 'M15_L1_S20', 'Mill Brook', > 'Bowerbank', '', '', '', '', '', '', '', '', '' > ); > > MySQL said: > > #1054 - Unknown column '20' in 'field list' > > Actually the first time, it was column 21, so to trouble shoot, I removed > that column from csv file and field name in phpMyAdmin. > > > camp_phone should be the last field but > `20` , `21` , `22` , `23` ) > is there too... > Any assistance most appreciated! > > I checked the file and didn't see any odd entries after the camp_phone > field. > > > > > > -- > Patrice Olivier-Wilson > 888-385-7217 > http://biz-comm.com > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=mdyk...@gmail.com > > -- - michael dykman - mdyk...@gmail.com Don’t worry about people stealing your ideas. If they’re any good, you’ll have to ram them down their throats! Howard Aiken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Inserting csv
Newbie question, please. I have a csv file of 950 records, 20 fields. I used this converter http://csv2sql.evandavey.com/ and copied/pasted insert code into SQL in phpMyAdmin and got this error SQL query: INSERT INTO membership( `members_ID` , `updated` , `notes` , `preferred_mail_street` , `preferred_mail_csz` , `first_name` , `last_name` , `street` , `city` , `state` , `zip` , `location_code` , `property` , `camp_street` , `camp_city` , `camp_zip` , `member_year` , `director` , `email` , `camp_phone` , `20` , `21` , `22` , `23` ) VALUES ( '', '', '', '', '', 'xxx', '', '102 Summer St', 'Dover-Foxcroft', 'xx', '04426', 'B', 'M15_L1_S20', 'Mill Brook', 'Bowerbank', '', '', '', '', '', '', '', '', '' ); MySQL said: #1054 - Unknown column '20' in 'field list' Actually the first time, it was column 21, so to trouble shoot, I removed that column from csv file and field name in phpMyAdmin. camp_phone should be the last field but `20` , `21` , `22` , `23` ) is there too... Any assistance most appreciated! I checked the file and didn't see any odd entries after the camp_phone field. -- Patrice Olivier-Wilson 888-385-7217 http://biz-comm.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: is_string or is_numeric
Do your realy need to know the differenz ? take everything as "string". (breaks with pics/geodata but helps a lot). re, wh sangprabv schrieb: > Hi, > I found no built in function in mysql to check whether a record is > numeric or string. Is there any trick to do so? Many thanks. > > > > > Willy > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: is_string or is_numeric
Only in the case you want to know the datatype and not the actual type of information in a char field! If you issue: show fields from MyTable like 'FName'; you get: +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | FName | varchar(255) | YES | | NULL| | +---+--+--+-+-+---+ although is not a function if you place the result into an array on the application side you can pull the value of the Type attribute. Hope this helps anyway! Claudio 2009/10/15 Glyn Astill > > From: sangprabv > > Subject: is_string or is_numeric > > To: mysql@lists.mysql.com > > Date: Thursday, 15 October, 2009, 10:34 AM > > Hi, > > I found no built in function in mysql to check whether a > > record is > > numeric or string. Is there any trick to do so? Many > > thanks. > > You could use some regex to do it... > > In fact, a google brings up this ( > http://forums.mysql.com/read.php?60,1907,241284#msg-241284) > > CREATE FUNCTION ISNUMERIC(myVal VARCHAR(1024)) > RETURNS TINYINT(1) DETERMINISTIC > RETURN myVal REGEXP '^(-|\\+)?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$'; > > > Glyn > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?unsub=claudio.na...@gmail.com > > -- Claudio
Re: is_string or is_numeric
> From: sangprabv > Subject: is_string or is_numeric > To: mysql@lists.mysql.com > Date: Thursday, 15 October, 2009, 10:34 AM > Hi, > I found no built in function in mysql to check whether a > record is > numeric or string. Is there any trick to do so? Many > thanks. You could use some regex to do it... In fact, a google brings up this (http://forums.mysql.com/read.php?60,1907,241284#msg-241284) CREATE FUNCTION ISNUMERIC(myVal VARCHAR(1024)) RETURNS TINYINT(1) DETERMINISTIC RETURN myVal REGEXP '^(-|\\+)?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$'; Glyn -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
is_string or is_numeric
Hi, I found no built in function in mysql to check whether a record is numeric or string. Is there any trick to do so? Many thanks. Willy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MySQL GUI Tools
> What are the best MySQL GUI tools available at the moment, for example > SQLyog. You could start with our AnySQL Maestro (free version available). http://www.sqlmaestro.com/products/anysql/maestro/ Sincerely yours, SQL Maestro Group Team http://www.sqlmaestro.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
RE: MySQL Cluster / NDB & MyISAM mix
Thanks. Yes it's a delicate construct but tables like 'IP2Location' give me a headache as NDB tables. Yet I have to test if 7.0.X can handle it. -Original Message- From: Michael Dykman [mailto:mdyk...@gmail.com] Sent: Mittwoch, 14. Oktober 2009 17:33 To: Christian Meisinger Cc: mysql@lists.mysql.com Subject: Re: MySQL Cluster / NDB & MyISAM mix I can think of no reason why this shouldn't work, My administrator colleagues would probably beat me with 2x4's for handing them such a delicate construct to maintain in production but it seems perfectly feasible to me :-) - michael dykman On Wed, Oct 14, 2009 at 11:03 AM, Christian Meisinger wrote: > Hi guys. > > Ok lets say i've 2 server running MySQL, NDB node and NDB manager on each. > Now I don't want to convert all tables to NDB instead I leave a few as > MyISAM. > Is it officially supported if I setup a master-master replication between > the two MySQL instances and add ignore entries for all NDB tables? > > So basically I would convert all important tables to NDB and leave other > tables as MyISAM, but they would still be 'synced' via replication. > > I've tested it and it look like it works... but... does it work by > coincidence? :) > > > Thanks, chris > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=mdyk...@gmail.com > > -- - michael dykman - mdyk...@gmail.com Dont worry about people stealing your ideas. If theyre any good, youll have to ram them down their throats! Howard Aiken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MySQL GUI Tools
What are the best MySQL GUI tools available at the moment, for example SQLyog. Have you tried Database Workbench (Pro) yet? See www.upscene.com With regards, Martijn Tonies Upscene Productions http://www.upscene.com Download Database Workbench for Oracle, MS SQL Server, Sybase SQL Anywhere, MySQL, InterBase, NexusDB and Firebird! Database questions? Check the forum: http://www.databasedevelopmentforum.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org