#mysql
07 October 2007
Total 21 pages. You are browsing page 3/21.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
02:14 <****> sauvin: simple data search, but need it robust and able to correct mis-spelled user input
02:16 <****> jerliqur2, doesn't mysql have a "serial" or "bigserial" type?
02:16 <****> ramy, yes, your subject agrees with most db work, but... what kind of data?
02:17 * sauvin looks at a dump he just created
02:17 <****> jerliqur2: last_insert_id()
02:17 <****> Xgc, that's regular mysql sql?
02:17 <****> sauvin: Yes. SELECT last_insert_id();
02:18 <****> Ah!
02:18 <****> sauvin: You must have inserted previously with the same connection.
02:19 <****> That would seem to be implied, yes. This dump I just created, it talks about "`id` int(11) NOT NULL auto_increment" as a field in a table structure - does that mean serial not null?
02:20 <****> serial?
02:20 <****> That's a postgresql type.
02:20 * sauvin is trying to understand this dump
02:21 <****> thats how you typically do an autoincrement primary key :)
02:21 <****> id int not null auto_increment primary key
02:21 <****> Drats. That means sucking this db into postgres isn't going to be "grab and plop".
02:21 <****> sauvin: serial is probably version 4.1 or better.
02:21 <****> either insert 0 or omit from inserts and it autoincrements
02:23 * sauvin considers using mysql as a source and just populating a postgresql db with elements from his existing mp3 collection
02:29 <****> hello
02:29 <****> how can i change the password for root ?
02:31 <****> Which root?
02:32 <****> the mysql 'root' account
02:32 <****> mysqladmin -u root password
02:32 <****> is there a reason why the second time I run a boolean fulltext search it is about 20x faster than the first time?
02:33 <****> well, yes
02:33 <****> it's called "caching"
02:33 <****> thank you
02:34 <****> I have the caching mode set to be only cached if I use the SQL_CACHE identifier
02:35 <****> and ? what do you think get scached when you do that ? you have no influence on what DATA gets cached, and indexes get cached whenever possible - including full-text ones
02:36 <****> ok
02:36 <****> thanks
02:44 <****> How do I combine an UPDATE and a SELECT in one statement (as in "operate on this table setting one field to one thing depending on a second field, and then for each of those affected rows give me the value for a third field"?)
02:45 <****> Anonycat: You can JOIN in an UPDATE with MySQL.
02:46 <****> Has anyone here used MySQL with the new FileMaker Pro 9?
02:46 <****> how does join help me do what I want to do?
02:47 <****> Anonycat: Think about how your SELECT relates to the table you plan to UPDATE.
02:47 <****> Anonycat: If it's just a single value being updated in a single row, Just use a simple subselect in the SET clause.
02:48 <****> Anonycat: Otherwise, JOIN would allow you to make a more general update over some variable number of rows.
02:49 <****> Xgc, I am not able to backup the database yet. That is unbelieveble!!!. I have tried by using a php script but when I back it up again I miss 500 MB
02:49 <****> it's a table of ranking statistics, and I want to look through for all stats on a specified chart or charts that have a rank of 1, set those stats to suspended, and fetch the names of all members who had stats affected this way
02:49 <****> wfq_: Maybe you should avoid php for this.
02:50 <****> so "SELECT name FROM stats WHERE {UPDATE stats SET status="suspended" WHERE chart IN ($charts) AND rank=1}"?
02:50 <****> Anonycat: You can't return selected values and update data in the same single SQL statement, unless you plan to call a stored procedure of some kind.
02:51 <****> Anonycat: Sorry. That's not valid SQL.
02:51 <****> Xgc, yes but I tried http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html and I could even get it working
02:51 <****> Anonycat: But there are ways you could obtain that detail.
02:53 <****> Anonycat: The trick is to perform the update and using some unique identifier to determine which rows were updated. Then select to obtain those rows.
02:53 <****> actually there is just such a detail left out of that query, and it works
02:53 <****> as long as that statement isn't being called twice or more in the same second, anyway
02:58 <****> Im after some.. feedback.. on my database design
02:59 <****> Ive pasted it at http://shanes.dyndns.org/shane/Setup.sql
02:59 <****> What concerns me most is my use of foreign keys
03:00 <****> Xgc,is it possible mysql is getting crashed in a backing up process due to the timeout?
03:03 <****> b0nn_ nothing wrong with that, why the teams ? they're not used anywhere else
03:04 <****> adaptr: They appeared to me to be a repeating group
03:04 <****> Or rather, had the potential to be
03:05 <****> b0nn_ the team ? but it's a single reference, which is not used anywhere else
03:05 <****> ah grr
03:05 <****> Game should be referencing team x2
03:05 <****> unless you fscked up and should really have used temas instead of clubs in the games table
03:05 <****> well, it isn't
03:05 <****> lol ta :-)
03:06 <****> hi
03:07 <****> is it possible to do a conditional WHERE clause?
03:07 <****> a where clause IS a conditional
03:07 <****> so, yes
03:07 <****> for example, WHERE id=n OR _parent=n -- but with the possibility of _parent not existing in said table ?
03:07 <****> OR parent IS NULL
03:07 <****> ?
03:08 <****> I'm saying, if the _parent column doesn't exist at all
03:08 <****> will the query choke
03:08 <****> that returns TRUE when there is no parent for that record
03:08 <****> is there a way around it
03:08 <****> if the parent column doesn't exist then it has no place in the query - SQL is by definition a determinate language, all tokens must be known beforehand
03:09 <****> well, I'm cheating
03:09 <****> course you are
03:09 <****> I was trying to make it generic, but I'm being lazy about it
03:09 <****> there is a function to return columns, yes
03:09 <****> so there's no way to do that? only do the conditional check if the column exists?
03:11 <****> adaptr, this function, it's just the describe function, right?
03:11 <****> or is there something else?
03:16 <****> what type of column should a password be (varchar(#))?
03:17 <****> http://pastebin.com/d7fe07426 hmpf..
03:17 <****> anyone know what could be wrong?
03:17 <****> ohh or nvm :p
03:18 <****>DATE<- diff ^^
03:18 <****> zach_, depends on the encryption/hashing methods you're using to store the password
03:18 <****> if you're letting mysql do the hashing, I think it uses 16 chars
03:19 <****> if you're using MD5, it's 32
03:19 <****> m5d
03:19 <****> ?
03:19 <****> md5
03:19 <****> ahh
03:19 <****> brb
03:19 <****> so varchar and set it to the number of chars
03:21 <****> breakerfall: right you are it's 32
03:21 <****> sha1 is 40
03:27 <****> exit
03:27 <****> the_wench exits (connection reset by luser)
Total 21 pages. You are browsing page 3/21.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
