[development] no DROP TABLE in sql files

Morbus Iff morbus at disobey.com
Mon Dec 12 16:58:25 UTC 2005


> the just installed state. This would include DROP TABLEs, caches, cookies,
> etc. I don't have root access and am left with files owned by apache so

I use a simple one-liner for deleting the Drupal database:

  mysql drupal -e "SHOW TABLES" | awk '{print "DROP TABLE "$1";"}'
    | tail +2 | mysql drupal

That prints out every table in the "drupal" database, adds a "DROP 
TABLE" prefix, and then pipes it back into MySQL. After that, it's just 
a simple matter of "mysql drupal < database/database.mysql", and I'm 
back to square one, WITHOUT having to reset MySQL authentication (or the 
settings.php). It's worked well enough in everyday usage.

-- 
Morbus Iff ( united we're bland )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus


More information about the development mailing list