Cách sử dụng lệnh MySQL trên Linux để Backup và Restore database

Khi bạn cần export/import nhưng file lớn tới vài trăm MB mà bạn sử dụng giao diện để thực hiện sẽ mất thời gian và thao tác dễ sai, cách xử lý an toàn và hiệu quả nhất là sử dụng cmd của linux để xử lý

Truy cập SSH vào VPS, Server với quyền root

Hướng dẫn truy cập vps/server vào Linux bằng SSH

Phương án 1. Lệnh mysqldump để backup database

Để backup database, bạn cần có đầy đủ thông tin của database cần backup gồm : user , database name, password của database.

Khi có đầy đủ thông tin các bạn chạy lệnh:

mysqldump –opt -u cuongnv_demo -p cuongnv_demo > filenewmoi.sql


Trong đó:

cuongnv_demo : User của database
cuongnv_demo : Tên của database
filenewmoi.sql : Tên tập tin cần lưu lại, tập tin này phải có dạng mở rộng là .sql.
–opt : Các tùy chọn mysqldump

Phương án 2. Lệnh mysql để restore database

Để restore database, bạn cần tạo mới một database gồm: user database, database name, pass.

Khi có đầy đủ thông tin các bạn chạy lệnh:

mysql -u cuongnv_demo -p cuongnv_demo < filenewmoi.sql


Trong đó:

cuongnv_demo : User của database
cuongnv_demo : Tên của database
filenewmoi.sql : Đường dẫn tới tập tin .sql cần phục hồi.

Chúc các bạn thành công !

Nếu trong quá trình thực hiện xảy ra lỗi hay sự cố gì, các bạn có thể liên hệ bộ phận kỹ thuật để được giúp đỡ. Hiện tại BKHOST có các cách liên hệ như sau:
• Liên hệ qua số tổng đài 024 7303 8088, sau đó ấn phím 2 để gặp BPKT.
• Gửi ticket thông qua trang web id.bkhost.vn.
• Live chat trực tiếp trên trang chủ BKHOST.
• Hỗ trợ từ xa thông qua TeamView hoặc Ultraview.

superbetin güncel giriş superbetin giriş superbetin Onay kodu Sanal numara Mobil onay SMS onay superbetin güncel giriş superbetin giriş superbetin superbetin superbetin güncel giriş superbetin giriş superbetin superbetin superbetin güncel giriş superbetin giriş superbetin superbetin perabet güncel giriş perabet giriş perabet perabet perabet güncel giriş perabet giriş perabet perabet betsat güncel giriş betsat giriş betsat betsat xslot güncel giriş xslot giriş xslot xslot cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet grandpashabet güncel giriş grandpashabet giriş grandpashabet grandpashabet güncel giriş grandpashabet giriş grandpashabet grandpashabet güncel giriş grandpashabet giriş grandpashabet grandpashabet güncel giriş grandpashabet giriş grandpashabet wbahis güncel giriş wbahis giriş wbahis wbahis wbahis güncel giriş wbahis giriş wbahis wbahis robinbet güncel giriş robinbet giriş robinbet robinbet robinbet güncel giriş robinbet giriş robinbet robinbet robinbet güncel giriş robinbet giriş robinbet robinbet timebet güncel giriş timebet giriş timebet timebet betsilin güncel giriş betsilin giriş betsilin betsilin betsilin güncel giriş betsilin giriş betsilin betsilin avrupabet güncel giriş avrupabet giriş avrupabet avrupabet avrupabet güncel giriş avrupabet giriş avrupabet avrupabet betpas güncel giriş betpas giriş betpas betpas betpas güncel giriş betpas giriş betpas betpas casinoroys güncel giriş casinoroys giriş casinoroys casinoroys casinoroys güncel giriş casinoroys giriş casinoroys casinoroys parmabet güncel giriş parmabet giriş parmabet parmabet parmabet güncel giriş parmabet giriş parmabet parmabet süratbet güncel giriş süratbet giriş süratbet süratbet süratbet güncel giriş süratbet giriş süratbet süratbet galyabet güncel giriş galyabet giriş galyabet galyabet galyabet güncel giriş galyabet giriş galyabet galyabet betwoon güncel giriş betwoon giriş betwoon betwoon betwoon güncel giriş betwoon giriş betwoon betwoon norabahis güncel giriş norabahis giriş norabahis norabahis norabahis güncel giriş norabahis giriş norabahis norabahis timebet güncel giriş timebet giriş timebet timebet timebet güncel giriş timebet giriş timebet timebet robinbet güncel giriş robinbet giriş robinbet robinbet robinbet güncel giriş robinbet giriş robinbet robinbet jojobet güncel giriş jojobet giriş jojobet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet betcio güncel giriş betcio giriş betcio betcio güncel giriş betcio giriş betcio cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet bahislion güncel giriş bahislion giriş bahislion jojobet güncel giriş jojobet giriş jojobet jojobet güncel giriş jojobet giriş jojobet betcio güncel giriş betcio giriş betcio betcio güncel giriş betcio giriş betcio cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet cratosroyalbet güncel giriş cratosroyalbet giriş cratosroyalbet cratosroyalbet grandpashabet güncel giriş grandpashabet giriş