Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

09 November 2007


Total 27 pages. You are browsing page 3/27.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

01:31 <****> help
01:31 <****> thanks
01:32 <****> should i remove the ifnull's?
01:32 <****> oops, mistype - do need some help though. Is it possible to use a fractional INTERVAL in something like DATE_ADD?
01:33 <****> pabst, np
01:33 <****> mikegriffin_, yes, parsing a copy of the very fast growing logfile... but this is almost useless :) it takes a lot of time and doesnt allow realtime tracking of the queries.
01:33 <****> hm :((
01:33 <****> yadayada: Yes. You can remove the IFNULL() calls.
01:33 <****> so, i will start up 3 servers now
01:34 <****> one for productibe use, one for developement, one for tests, one for special users , etc etc etc
01:34 <****> I have a field which is a number of months to add... DATE_ADD(datefield, INTERVAL monthsfield MONTH)... is there a way to change this to be only half a month?
01:34 <****> INTERVAL 0.5
01:34 <****> does this take a lot of more ram than only one running server?
01:34 <****> MONTH is no good :P
01:34 <****> turtlexiv: expression / 2
01:35 <****> :))
01:35 <****> Xgc: the interval is coming from a database field, I don't necessarily know what it is...
01:35 <****> turtlexiv: expression doesn't care what it is either.
01:36 <****> I'm not following you... I've mad the field with the number of months a float, and am using 0.5 to represent half a month, but this approach isn't working
01:36 <****> now if i want to allow remote connections to my mysql server i need to edit something in my.cf right?
01:37 <****> er my.cnf
01:37 <****> Using any kind of fractional value for the interval, I end up with a date exactly one month in the future (eg, it rounds)
01:37 <****> Xgc: works great! thanks alot
01:38 <****> turtlexiv: 0.5 months is somewhat meaningless. You either get 1 or 0. 6 / 2 = 3, is meaningful. Partial months is not meaningful.
01:38 <****> yadayada: You're welcome.
01:38 <****> Xgc: okay, that's what I was wondering. So the only way to do it would be to use days?
01:38 <****> turtlexiv: If you weant it rounded down, you can do that.
01:39 <****> turtlexiv: Days would be one way. Sure.
01:39 <****> Xgc: one question, which do you think would be faster and more efficient, running this query or pulling two tables and using php to do the math?
01:39 <****> turtlexiv: But you still only get hole days calculations.
01:39 <****> s/hole/whole
01:39 <****> Xgc: right... I'm either selecting by whole months, or half of one month
01:40 <****> yadayada: That is prefectly fine directly done in SQL.
01:40 <****> s/pre/per
01:40 <****> ok cool, thanks again!
01:40 <****> turtlexiv: Half is not whole. There's no such thing as half a month.
01:40 <****> turtlexiv: There's no fixed size month.
01:41 <****> Xgc: Right, I suppose I'm mis-describing. A better description would be whole months, or 15 days.
01:41 <****> turtlexiv: Then use days/2.
01:42 <****> Xgc: Well, if I changed my source months field to days, and then used average length months (eg, represent 2 months as 60 days), I wouldn't really get what I wanted there either...
01:43 <****> Xgc: Unless you can suggest a better idea in MySQL (I'm not familar enough with it), I suppose I'd just have to do something kind of ugly in PHP.. select the months field, if its set to 0.5, then rewrite the query for 15 days :/
01:43 <****> turtlexiv: Then you haven't described your requirement yet.
01:44 <****> Xgc: I think I'm just approaching this the wrong way.
01:45 <****> Xgc: Essentially, my existing query simply selected a certain number of months in the future. I'm trying to add a representation of "
01:45 <****> "half a month", or rather 15 days, if months = 0.5
01:45 <****> But I don't think there is any way I can simply modify the existing query.
01:46 <****> In sum: if the 'months' field is 0.5, select by INTERVAL 15 DAY instead of INTERVAL months MONTH
01:46 <****> turtlexiv: What if it's 2.5?
01:46 <****> It won't be
01:47 <****> turtlexiv: then what will it be, exactly? What is the possible range of values?
01:47 <****> That's important to the question.
01:47 <****>= 1
01:48 <****> turtlexiv: I guess you'll have to handle that specially. It sounds like a mistake.
01:51 <****> Xgc: Is there some way to do it with a mysql IF?
01:51 <****> turtlexiv: Sure. CASE / WHEN / THEN / END
01:52 <****>=1 THEN ... MONTH ELSE ... DAYS END
01:53 <****> Yeah, I'm looking through the docs now, never done any kind of if/else in a SQL statement :/
01:54 <****> re
01:57 <****> Xgc: can you point me in the direction of a clear if/else example?
01:58 <****> hmmm what if the hostname i am connecting to a database from is dynamic? how do I give myself permissions then?
01:58 <****> I can't seem to figure out how the heck this works
01:58 <****> turtlexiv: Sure. One moment.
01:59 <****> turtlexiv: Do you have SQL that does what you want for WHOLE MONTHs?
01:59 <****> yeah.
01:59 <****> pabst: Use % as a wildcard. (for part or all)
01:59 <****> 1 sec
02:00 <****> Xgc: pastebin.com/d159068f3
02:00 <****> Howdy
02:03 <****> _Lemon_: Thanks so... GRANT ALL ON db.* TO 'user'@'%' IDENTIFIED BY 'password';?
02:04 <****> If it works, I guess so!
02:04 <****> hi, im getting a 1045 error while trying to connect as root to a table, on my msql server i've alreade made a grant all table.* root@theotherhost what can be wrong (also added the host to /etc/hosts)
02:04 <****> Although beware, you're losing extra security :(
02:04 <****> !perror 1045
02:04 <****> What's error 1045?
02:04 <****> I don't memorise them by numbers :p
02:05 <****> worked, yay!
02:05 <****> aparently wrong user/password
02:05 <****> which is out of the question, i can acces with thar usr/psw from my server without problems
02:06 <****> _Lemon_: Thanks so... GRANT ALL ON db.* TO 'user'@'%' IDENTIFIED BY 'password';?
02:07 <****> anybody know a way to get the Query Browser to edit tables without a primary key?
02:10 <****> Xgc: Did I lose you?
02:16 <****> oh my host column in mysql.user was not up to date :D
02:20 <****> turtlexiv: http://rafb.net/p/PzfVfk52.html
02:21 <****> 0.6 is due to the inaccuracy of floats. You can't test for equality safely.
02:25 <****> kk, let me play with that
02:27 <****> Xgc: I see how that works now
02:28 <****> Xgc: thanks so much for the help, and idiot-proofing it for me :P
02:28 <****> turtlexiv: You're welcome.
02:29 <****> what is the largest value for varchar(128)?
02:30 <****> 127? 255? something like that? i honestly have no idea, as you can tell...
02:30 <****> LOL
02:30 <****> it would be a 128-char field
02:31 <****> iam8up|dsc: It means that it can hold a maximum of 128 characters
02:31 <****> and is store dynamically, opposed to CHAR which will pad the remaining of the unused bytes with NULL
02:31 <****> what?! i was reading this page: http://dev.mysql.com/doc/refman/5.0/en/char.html and it says " he length can be specified as a value from 0 to 255 before MySQL 5.0.3,"
02:32 <****> got my answer now anyways, berlios is back up (for now =)
02:32 <****> thanks for the explanation, though!
02:32 <****> the VAL in () specifies ...
02:35 <****> so is that 128 characters/bytes?
02:36 <****> that depends on your definition of a byte.


Total 27 pages. You are browsing page 3/27.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo