Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

htaccess multiple authuserfile, www.xxx.con, www.xxxcon, wwwxxx100www, www...xxxcon, www.xxxcon, error 1025 mysql errno:150, xxx.con, w.w.w.xxxcon, www,xxx.con

Links

XODOX
Impressum

#1: Is deleting the .FRM, .MYD and .MYI files the same as droppingtable?

Posted on 2009-01-16 02:44:20 by Daevid Vincent

--=-sfU0bi2KOclx3/GtO4/v
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I've been tasked with cleaning up a bunch of 'eventum' tables that got
accidentally dumped into several databases and then replicated.

I'm wondering if I can just go through with a simple command to blow
these all away:

find /var/lib/mysql/ -name eventum*

Or is there some other magic that a "DROP TABLE eventum*" does?



--=-sfU0bi2KOclx3/GtO4/v--

Report this message

#2: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping

Posted on 2009-01-16 02:57:17 by John Daisley

--=-AHv62LZ5/tVeO6pCzMnz
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Well surely its a simple case of drop the tables on the master and let
replication do the rest!


John Daisley
Email: john.daisley@butterflysystems.co.uk
Mobile: 07812 451238

MySQL Certified Database Administrator (CMDBA)
MySQL Certified Developer (CMDEV)
MySQL Certified Associate (CMA)
Comptia A+ Certified Professional IT Technician

















On Thu, 2009-01-15 at 17:44 -0800, Daevid Vincent wrote:

> I've been tasked with cleaning up a bunch of 'eventum' tables that got
> accidentally dumped into several databases and then replicated.
>
> I'm wondering if I can just go through with a simple command to blow
> these all away:
>
> find /var/lib/mysql/ -name eventum*
>
> Or is there some other magic that a "DROP TABLE eventum*" does?
>
>
>
>
> ______________________________________________
> This email has been scanned by Netintelligence
> http://www.netintelligence.com/email

--=-AHv62LZ5/tVeO6pCzMnz--

Report this message

#3: Re: Is deleting the .FRM, .MYD and .MYI files the same as droppingtable?

Posted on 2009-01-16 03:57:19 by Daevid Vincent

--=-JZjkZZg5VyZHEwOWQq9y
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

you misunderstand me. I have three servers (dev, test, prod) that all
have maybe 3 databases EACH that have all these eventum* tables in them.
don't ask. a simple "trickle" won't do. I'm writing a script to loop
through them all.


On Fri, 2009-01-16 at 01:57 +0000, John Daisley wrote:

> Well surely its a simple case of drop the tables on the master and let
> replication do the rest!
>
>
> John Daisley





> On Thu, 2009-01-15 at 17:44 -0800, Daevid Vincent wrote:
>
> > I've been tasked with cleaning up a bunch of 'eventum' tables that got
> > accidentally dumped into several databases and then replicated.
> >
> > I'm wondering if I can just go through with a simple command to blow
> > these all away:
> >
> > find /var/lib/mysql/ -name eventum*
> >
> > Or is there some other magic that a "DROP TABLE eventum*" does?



--=-JZjkZZg5VyZHEwOWQq9y--

Report this message

#4: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping table?

Posted on 2009-01-16 04:10:23 by yueliangdao0608

------=_Part_105539_6355066.1232075423341
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Yeah, you're right.

On Fri, Jan 16, 2009 at 10:57 AM, Daevid Vincent <daevid@daevid.com> wrote:

> you misunderstand me. I have three servers (dev, test, prod) that all
> have maybe 3 databases EACH that have all these eventum* tables in them.
> don't ask. a simple "trickle" won't do. I'm writing a script to loop
> through them all.
>
>
> On Fri, 2009-01-16 at 01:57 +0000, John Daisley wrote:
>
> > Well surely its a simple case of drop the tables on the master and let
> > replication do the rest!
> >
> >
> > John Daisley
>
>
>
>
>
> > On Thu, 2009-01-15 at 17:44 -0800, Daevid Vincent wrote:
> >
> > > I've been tasked with cleaning up a bunch of 'eventum' tables that got
> > > accidentally dumped into several databases and then replicated.
> > >
> > > I'm wondering if I can just go through with a simple command to blow
> > > these all away:
> > >
> > > find /var/lib/mysql/ -name eventum*
> > >
> > > Or is there some other magic that a "DROP TABLE eventum*" does?
>
>
>


--
I'm a MySQL DBA in china.
More about me just visit here:
http://yueliangdao0608.cublog.cn

------=_Part_105539_6355066.1232075423341--

Report this message

#5: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping

Posted on 2009-01-16 04:46:57 by Jim Lyons

--0015174bf0f8bd90010460916ca5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

By the subject line, it would these are all MyISAM tables. If true, then
deleting the files should do the trick. If any of them happens to be an
InnoDB table, it won't work and you'll have to do some gyrations to get them
dropped. It'll be a mess.

Since you're accessing all the databases any way why not just loop through
all the servers with the command:

mysql -u<userid> -p<password> -h<server> -e'drop table if exists
<db>.eventum'

????



On Thu, Jan 15, 2009 at 7:44 PM, Daevid Vincent <daevid@daevid.com> wrote:

> I've been tasked with cleaning up a bunch of 'eventum' tables that got
> accidentally dumped into several databases and then replicated.
>
> I'm wondering if I can just go through with a simple command to blow
> these all away:
>
> find /var/lib/mysql/ -name eventum*
>
> Or is there some other magic that a "DROP TABLE eventum*" does?
>
>
>


--
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

--0015174bf0f8bd90010460916ca5--

Report this message

#6: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping table?

Posted on 2009-01-16 05:17:54 by Daniel Brown

On Thu, Jan 15, 2009 at 20:44, Daevid Vincent <daevid@daevid.com> wrote:
> I've been tasked with cleaning up a bunch of 'eventum' tables that got
> accidentally dumped into several databases and then replicated.
>
> I'm wondering if I can just go through with a simple command to blow
> these all away:
>
> find /var/lib/mysql/ -name eventum*
>
> Or is there some other magic that a "DROP TABLE eventum*" does?

To avoid corruption and keep things in sync, you *should* keep it
all in MySQL and DROP IF EXISTS.... but in a pinch or in dire
situations, I've killed the trio of files and restarted MySQL and
achieved the same result.

Short answer to the question in your subject, Daevid: yes, but
it's not the Right Way[tm].

Hello, by the way. ;-P

--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Report this message

#7: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping table?

Posted on 2009-01-16 06:04:41 by Baron Schwartz

On Thu, Jan 15, 2009 at 9:57 PM, Daevid Vincent <daevid@daevid.com> wrote:
> you misunderstand me. I have three servers (dev, test, prod) that all
> have maybe 3 databases EACH that have all these eventum* tables in them.
> don't ask. a simple "trickle" won't do. I'm writing a script to loop
> through them all.

mk-find --engine MyISAM --tbllike 'eventum%' --exec 'DROP TABLE %D.%N'


--
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Report this message

#8: Re: Is deleting the .FRM, .MYD and .MYI files the same as dropping table?

Posted on 2009-01-16 14:13:51 by ddevaudreuil

Daevid Vincent <daevid@daevid.com> wrote on 01/15/2009 09:57:19 PM:

> you misunderstand me. I have three servers (dev, test, prod) that all
> have maybe 3 databases EACH that have all these eventum* tables in them.
> don't ask. a simple "trickle" won't do. I'm writing a script to loop
> through them all.
>

The script below will create the Drop Table command for all tables like
'eventum%'.

select CONCAT('DROP TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ';')
from information_schema.TABLES
where TABLE_NAME like 'eventum%' and TABLE_TYPE <> 'VIEW'

Donna D.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Report this message

#9: Re: Removing Eventum WAS: Is deleting the .FRM, .MYD and .MYIfiles the same as dropping table? [solv

Posted on 2009-01-21 20:30:04 by Daevid Vincent

--=-F3op05asji7Fv0cZGHHs
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Thanks to Donna for that very useful SQL statement. Below is the script
I ended up writing to clean the eight-bajillion eventum_* tables that
accidentally got splattered into our servers.

Anyways, this is probably very useful for other types of bulk SQL stuff
via some BASH scripting so I figured I'd post it up if for no other
reason that navel gazing. :-)

BTW, this is not a reflection on Eventum, I've never even used it myself
to say either way if it's good/bad, I was just tasked (as a contractor)
to remove the tables from all six mySQL DB servers.

On Fri, 2009-01-16 at 08:13 -0500, ddevaudreuil@intellicare.com wrote:

> Daevid Vincent <daevid@daevid.com> wrote on 01/15/2009 09:57:19 PM:
>
> > you misunderstand me. I have three servers (dev, test, prod) that all
> > have maybe 3 databases EACH that have all these eventum* tables in them.
> > don't ask. a simple "trickle" won't do. I'm writing a script to loop
> > through them all.
> >
>
> The script below will create the Drop Table command for all tables like
> 'eventum%'.
>
> select CONCAT('DROP TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ';')
> from information_schema.TABLES
> where TABLE_NAME like 'eventum%' and TABLE_TYPE <> 'VIEW'
>
> Donna D.


#!/bin/bash

# written by Daevid Vincent on 01/15/09

# This will remove all the eventum tables and files

# make sure we're running as root
if (( `/usr/bin/id -u` != 0 )); then { echo "Sorry, must be root.
Exiting..."; exit; } fi

USERNAME=root
PASSWORD=secret
# .1 Dev Master
# .2 Dev Slave
# .3 Test Master
# .4 Test Slave
# .5 Prod Master
# .6 Prod Slave

MYSQLRDBMS="1 3 5 2 4 6"

echo

for ip in $MYSQLRDBMS; do
HOST=10.10.10.$ip
CONNECTION="-u $USERNAME -p$PASSWORD -h$HOST"

echo -e "\e[00;31m[DEBUG] `date`\e[00m"
echo -e "\e[01;37m[DEBUG] mysql $CONNECTION\e[00m"

echo -e "\e[01;32mFinding all 'eventum' instances across all databases
on $HOST...\e[00m"
# [dv] I started doing it this way, then discovered a better way below
from ddevaudreuil@intellicare.com but kept this for future reference.
#EDBS=$(mysql -sN $CONNECTION information_schema -e "SELECT DISTINCT
TABLE_SCHEMA FROM TABLES WHERE TABLE_NAME LIKE 'eventum%'")
#echo $EDBS
#for DB in $EDBS; do
# echo "Using database $DB"
# ETABS=$(mysql -sN $CONNECTION $DB -e "SHOW TABLES WHERE Tables_in_$DB
LIKE 'eventum%'")
# for ETABLE in $ETABS; do
# echo -n "Dropping table $ETABLE..."
# #mysql $CONNECTION $DB -e "DROP TABLE IF EXISTS $DB.$ETABLE"
# echo "Done"
# done
#done
DROPS=$(mysql $CONNECTION -sN -e "SELECT CONCAT(TABLE_SCHEMA, '.',
TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_NAME like
'eventum%' AND TABLE_TYPE <> 'VIEW'")
for DROPSQL in $DROPS; do
echo -e "\e[00;32m\tDROP TABLE $DROPSQL;\e[00m"
mysql $CONNECTION -sN -e "DROP TABLE IF EXISTS $DROPSQL;"
done
echo

echo "Sleeping (5)"
sleep 5
echo

done #hosts

# If you want to get rid of the rest of the eventum files that may never
get cleaned up
# b/c they're copies in dormant dirs, use this:
echo "Purging remaining 'eventum' from /var/www tree..."
sudo find /var/www -name "eventum*" -exec rm -rf {} \;

echo -e "\e[01;33mCompleted.\e[00m"



--=-F3op05asji7Fv0cZGHHs--

Report this message