Tuesday, February 8, 2011

Mysql dropping multiple tables

From

DROP TABLE phpbb_auth_access,
phpbb_banlist,
phpbb_categories,
phpbb_config,
phpbb_confirm,
phpbb_disallow,
phpbb_forum_prune,
phpbb_forums,
phpbb_groups,
phpbb_posts,
phpbb_posts_text,
phpbb_privmsgs,
phpbb_privmsgs_text,
phpbb_ranks,
phpbb_search_results,
phpbb_search_wordlist,
phpbb_search_wordmatch,
phpbb_sessions,
phpbb_sessions_keys,
phpbb_smilies,
phpbb_themes,
phpbb_themes_name,
phpbb_topics,
phpbb_topics_watch,
phpbb_user_group,
phpbb_users,
phpbb_vote_desc,
phpbb_vote_results,
phpbb_vote_voters,
phpbb_words;

Sh00t all done ;)

Now if you are lucky enough to have a ssh access on the server then you can do some tweaking with the mysql.

Let see how its done!

type this on your bash

$ mysql -u webmaster -p -e "show tables like 'stup_%'" web > result.txt

Replace webmaster with the database user and web with the database name

you will have a file named result.txt

now

gawk -F \n '{print ""$1"," }' result.txt > alltables.sql

you will then have a file name alltables.sql

next open up alltables.sql and replace first line with

DROP TABLE

and the last line should end with ;

then on bash

mysql -u webmaster -p web < alltables.sql

No comments:

Post a Comment

Popular Posts