SORU
16 Aralık 2009, ÇARŞAMBA


Tüm tabloları tek bir komut MySQL veritabanı kesecek?

Tek bir işlemle bir veritabanındaki tüm tabloları kesmek için bir sorgu (komut) var mı? Eğer tek bir sorgu ile bunu yapabilir miyim bilmek istiyorum.

CEVAP
18 Ocak 2012, ÇARŞAMBA


bırakın

mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done

kesecek

mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • colacas

    colacas

    29 EKİM 2006
  • The Fashion Sight

    The Fashion

    22 AĞUSTOS 2011
  • The Dubstep FX

    The Dubstep

    5 Mart 2011