Re: Missing database file names

2010-06-03 Thread Jesse F. Hughes
Dan Nelson writes: > In the last episode (Jun 02), Jesse F. Hughes said: >> After a recent hard drive kerfluffle and the results of fsck, I'm left >> with a slew of jumbled database files. The file command can tell me the >> file types, like so: >> >> #15901614: MySQL table definition file Vers

Re: replication of RENAME TABLE d1.t TO d2.t

2010-06-03 Thread Michael Dykman
Other way around. Assuming the aplcation is expecting your table to be named 'db.table1' and your replacement is newdb.table1 you can do the following. create a database for hold archives CREATE olddb; then RENAME TABLE db.table1 to olddb.table1, -- back up the current table newdb.table1 to d

replication of RENAME TABLE d1.t TO d2.t

2010-06-03 Thread Tom Worster
i've a need to change the name of a database and haven't done this before in our live server. while the tables are myisam, i'm not inclined to rename the dirname of d1's datafiles because i'd rather not interrupt service for other databases and i'd prefer if the renaming would replicate. can i do

Re: Missing database file names

2010-06-03 Thread Jesse F. Hughes
Dan Nelson writes: > In the last episode (Jun 02), Jesse F. Hughes said: >> After a recent hard drive kerfluffle and the results of fsck, I'm left >> with a slew of jumbled database files. The file command can tell me the >> file types, like so: >> >> #15901614: MySQL table definition file Vers

Re: Geting current user pasword.

2010-06-03 Thread Jim Lyons
llo, >   I need to get the user and password from the current session. I found the > user() function, wich gets the username, is there anything like that to get > the password ? > > Thx > > Guillermo > > > ______ Información de ESET NOD32 Antivirus, versión de la base

Re: Geting current user pasword.

2010-06-03 Thread Michael Dykman
me, is there anything like that to get > the password ? > > Thx > > Guillermo > > > __ Información de ESET NOD32 Antivirus, versión de la base de firmas > de virus 5170 (20100603) __ > > ESET NOD32 Antivirus ha comprobado este mensaje. > > http://w

Re: Geting current user pasword.

2010-06-03 Thread Dan Nelson
In the last episode (Jun 03), Guillermo said: > Hello, > I need to get the user and password from the current session. I > found the user() function, wich gets the username, is there anything > like that to get the password ? Nope. I don't think the server even sees the password during auth

Geting current user pasword.

2010-06-03 Thread Guillermo
(20100603) __ ESET NOD32 Antivirus ha comprobado este mensaje. http://www.eset.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: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
I am glad that I was able to help someone finally :) There may be other ways to do this, but that was what first came to mind. I would maybe run an explain on that query to ensure that it is using indexes. Steven Staples > -Original Message- > From: Michael Stroh [mailto:st...@astro

Re: Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
Thanks! That did it perfectly! Michael On Jun 3, 2010, at 11:45 AM, Steven Staples wrote: > How about this? > > SELECT >`first_table`.`names` >, `first_table`.`version` >, (SELECT > COUNT(`other_table`.`names`) > FROM `other_table` >

RE: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
How about this? SELECT `first_table`.`names` , `first_table`.`version` , (SELECT COUNT(`other_table`.`names`) FROM `other_table` WHERE `other_table`.`this_id` = `first_table`.`id`) AS 'count' FROM `first_table` WHERE `first_table`.`p

Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version of the result I'm aiming for. I'm pretty new to queries that act on multiple tables, so apologize if this is a very stupid question. I have one table (data) that has two column

RE: Slow when using sub-query

2010-06-03 Thread Jerry Schwartz
>-Original Message- >From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De >Meersman >Sent: Thursday, June 03, 2010 6:52 AM >To: je...@gii.co.jp >Cc: mysql@lists.mysql.com >Subject: Re: Slow when using sub-query > >The short answer is that the optimizer is amazingly stu

Re: Slow when using sub-query

2010-06-03 Thread Johan De Meersman
The short answer is that the optimizer is amazingly stupid about subqueries, and it assumes that they are dependent even when they're not - that subquery gets executed for every row in your main query. The fastest way to do this, would probably be to run your subquery, have your code assemble the