Mysqlden backup almak

Tagged:  

Zora düşünce MySqlDump kullanmak lazım. Nasıl backup alınır ve nasıl restore edilir. (Server'de bir ssh account yada mysql'in uzaktan erişime açık olması lazım!)

phpMyAdmin en büyük yardımcısıdır bir programcının. Fakat (az önce benim başıma gelen gibi) her zaman mümkün olmuyor. Bir şekilde çalışmıyor veya erişim izinleri vıdı vıdı derken, shell yolları gözüküyor.

kullanıcı, kullanıcı adınız,
şifre: şifreniz
db_adı: veritabanınızın adı ise şu komutu verebilirsiniz.

Ssh ile serverin içindeyseniz:
mysqldump -u kullanıcı -pşifre db_adı > yedek.sql

Genelde büyük verilerle uğraşıyoruz, ben 90MB'den düşük db'ye db demem! Demek ki bir gzip lazım:
gzip yedek.sql
Sonra diğer servere taşıdık veya bu yedek dosyasından geri döneceğiz,
gunzip yedek.sql

Bu yedek.sql dosyasını sonradan mysql'e geri göndermek için
mysql -u kullanıcı -pşifre db_adı < yedek.sql

verinizi kontrol edin. Ve büyük ihtimal büyük bir ohh çekin.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
           888                                        d8b 
888 Y8P
888
.d8888b 888 888 88888888 8888b. 8888b. 8888
88K 888 .88P d88P "88b "88b "888
"Y8888b. 888888K d88P .d888888 .d888888 888
X88 888 "88b d88P 888 888 888 888 888
88888P' 888 888 88888888 "Y888888 "Y888888 888
888
d88P
888P"
Enter the code depicted in ASCII art style.

Similar

  • New technique to win olimpics -

    New technique to win olimpics

    At the 1968 Olympics, Dick Fosbury took the athletics world by surprise with an unusual high-jump technique.

  • Printing mysql_error -

    Printing mysql_error

    This is a code snipped to print mysql error.
    If there is no error mysql_error returns null, thus if evaluates false and there is no output.

  • multiple ON DUPLICATE KEY UPDATE -

    multiple ON DUPLICATE KEY UPDATE

    Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.

  • multiple ON DUPLICATE KEY UPDATE -

    multiple ON DUPLICATE KEY UPDATE

    Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.

  • php unlink recursive -

    php unlink recursive

    The shortest recursive delete possible.

    <?php
    /**
    * Delete a file or recursively delete a directory
    *
    * @param string $str Path to file or directory
    */