Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Thu Mar 28, 2024 9:11 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

Great! I solved.
Yes 50%  50%  [ 1 ]
No 50%  50%  [ 1 ]
Total votes : 2
Author Message
PostPosted: Fri Aug 25, 2006 7:44 am 
Offline
Newbie
User avatar

Joined: Wed Aug 16, 2006 9:06 am
Posts: 45
Location: Rome - Italy - Europe (GMT +2)
Probably i discovered the hot water but to solve the problems with mysql 5.0 ( [color=red]Data too long for column 'column_name' at row n[/color] ), you have to modify the file my.ini from
[quote]sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

to
[quote]sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

In that way the fields "too long" are trunked at the VARCHAR length.

_________________
[color=blue]Lorenz[/color]


Last edited by lorenz on Fri Aug 25, 2006 7:52 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 7:50 am 
I don't understand. You had errors with columns being to short (and the data too long), so how is this better than just making the columns wider?


Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 7:55 am 
Offline
Newbie
User avatar

Joined: Wed Aug 16, 2006 9:06 am
Posts: 45
Location: Rome - Italy - Europe (GMT +2)
Yes, you are right.
But what's appen if the filed is longer than 255 characters?

I think could be right do both things, make column wider and modify my.ini.
Don't you think so?

_________________
[color=blue]Lorenz[/color]


Last edited by lorenz on Fri Aug 25, 2006 7:59 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 7:57 am 
If it's longer than 255, then we'll expand the column... not too hard.


Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 7:59 am 
[quote]For STRICT_TRANS_TABLES, MySQL converts an invalid value to the closest valid value for the column and insert the adjusted value. If a value is missing, MySQL inserts the implicit default value for the column data type. In either case, MySQL generates a warning rather than an error and continues processing the statement. Implicit defaults are described in Section 11.1.4, “Data Type Default Values”.


[url]http://mysql.binarycompass.org/doc/refman/5.0/en/server-sql-mode.html[/url]

Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 8:00 am 
Offline
Newbie
User avatar

Joined: Wed Aug 16, 2006 9:06 am
Posts: 45
Location: Rome - Italy - Europe (GMT +2)
Remember that are no alerts if an insert (or update) goes wrong.
The best could be to create a feedback (via mail, for example) if something goes wrong during an insert (or update).
It could be simple to realize. It will work in the server side!

_________________
[color=blue]Lorenz[/color]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 8:04 am 
Yep, that thought popped into my head.


Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 8:11 am 
Offline
Newbie
User avatar

Joined: Wed Aug 16, 2006 9:06 am
Posts: 45
Location: Rome - Italy - Europe (GMT +2)
[quote="mikeyrb"][quote]For STRICT_TRANS_TABLES, MySQL converts an invalid value to the closest valid value for the column and insert the adjusted value. If a value is missing, MySQL inserts the implicit default value for the column data type. In either case, MySQL [color=red]generates a warning rather than an error[/color] and continues processing the statement. Implicit defaults are described in Section 11.1.4, “Data Type Default Values”.

[url]http://mysql.binarycompass.org/doc/refman/5.0/en/server-sql-mode.html[/url]


Yes, but, if i don't go wrong, PHP dies if MySQL returns an error.
There are many inserts (or update) done after another insert (or update) and the sequence is very strict. If the first fails, all others following fail.

If you want i can try to reproduce this kind of error on my server to explane better the problem.

_________________
[color=blue]Lorenz[/color]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 8:32 am 
Wrong, we choose when we should die if mysql returns an error.


Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 25, 2006 9:50 am 
Offline
Newbie
User avatar

Joined: Wed Aug 16, 2006 9:06 am
Posts: 45
Location: Rome - Italy - Europe (GMT +2)
Ok, but it's a fact that if mysql has a problem with an insert or an update the machine is not inventored or there are some problems of suitability in the collected data.

Please try creating an alert system for the "collecting" phase. In that way it will be possible to monitor and tune the table structure to avoid future errors.

;) Bye!

_________________
[color=blue]Lorenz[/color]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group