Mandich: Naktibalda, i am in rails and i am using a gem called mysql2 where i can do this: mysql.query”” . So i have to put all my query in this. So doing this: mysql.query”update test.entries set description = ‘#{value}’ where id = ‘1’”
Yerby: Does it escape parameters automatically?
Mandich: Naktibalda, you can see that above
Mandich: That comes from rails
Mandich: So with value being equal to the string above i get a Risse error
Zalenski: Use mysql.escape method
Mandich: Removing the char solves the problem
Mandich: You mean only for the char ?
Keeble: Read about Usage in https://github.com/brianmario/mysql2
Lisanti: For a whole parameter
Gilmour: If you don’t use it, your code is insecure
Tizon: Hi, I just installed mysql in freebsd and I think I don’t have a root user. I can’t change the root p***wd in mysql and I can’t create user too : I try to restart with skit grant, so I can’t create and trying to update mysql.USER give me error
Mandich: Naktibalda, thanks a lot, i used the mysql2 gem but was too careless not to notice the basics! Thanks that did the trick.
Mckeithan: I restart with: ysql_args=”–skip-grant-tables –skip-networking” I do: mysql -u root mysql UPDATE mysql.USER SET P***word=P***WORD’Your new p***word’ WHERE USER=’root’ ERROR 1146 42S02: Table ‘mysql.USER’ doesn’t exist
Gowell: Impossible to import 43M file in phpmyadmin.
Criswell: I try to increase php at 128M. for some parameters, nothing work.
Difillippo: Booh: mysql -u uname -p dbname yourfile.sql
Joly: I have a boolean column with the following values, true, false, and NULL. I’m trying to select all values not true and trying SELECT . WHERE col1 TRUE, but the NULL rows don’t get selected
Joly: Why is that? and what’s the proper way to do it?
Danella: Joly: Nothing equals null and nothing does not eual null. Use IS NULL and IS NOT NULL
Prichard: Joly: null x is never true.
Torry: Is it possible to convert a value of a field to another value ? Like if value = 4 change to 24?
Henne: Joly: CASE END expression.
Debes: Goddard: That was to you.
Euser: Goddard: You can also use a mapping table, if you have many values to map.
Furber: Goddard: Then you would just join.
Zwickl: Goddard: do you want to update data in table or just change a result of select?
Copstead: Naktibalda: i just want to change it on select so I can export it
Hert: Im using mysql workbench
Moravek: Those methods work for either
Joly: Xgc, so the only way to write it is WHERE col1 = false OR col1 IS NULL ?
Joly: That makes me a little sad 😛
Moravek: Null in an inequality condition is always false
Moravek: Well, if your app treats null as false, just update the data to be false and make the field not nullable
Kirkpatrick: Joly: That’s one way. Also, WHERE NOT col1 = true
Moravek: Yeah, that also works, shorter but not so straightforward
Joly: Xgc, = that’s a good one
Menino: Joly: Null safe equals.
Spanner: How to make clear that date1.date2 has some common part with date3.date4 period they are periods ?
Hallie: Krisostoomus: Overlapping ranges.
Overkamp: What does this kind of query do: select * from A where A.start or A.end between X1 and X2 . Would it work?
Willette: Krisostoomus: no, it won’t do what you expect. the BETWEEN . AND binds stronger than the OR. you can read that above as WHERE A.start or A.end between X1 and X2
Willette: Krisostoomus: so your A.start will be treated as a boolean expression, meaning that all rows which have A.start != 0 will be returned regardless of A.end being between X1 and X2
Hipp: So what do you suggest?