TAILIEUCHUNG - Học php, mysql và javascript - p 25

Các lệnh trong ví dụ 9-8 lưu trữ tập tin sao lưu vào thư mục hiện hành. Nếu bạn cần nó để được lưu ở nơi khác, bạn nên chèn một đường dẫn tập tin trước khi tên tập tin. Bạn cũng phải đảm bảo rằng các thư mục bạn đang sao lưu để có đủ quyền hạn thiết lập để cho phép các tập tin được ghi. | The command in Example 9-8 stores the backup file into the current directory. If you need it to be saved elsewhere you should insert a file path before the filename. You must also ensure that the directory you are backing up to has the right permissions set to allow the file to be written. If you echo the backup file to screen or load it into a text editor you will see that it comprises sequences of SQL commands such as the following DROP TABLE IF EXISTS classics CREATE TABLE classics author varchar 128 default NULL title varchar 128 default NULL category varchar 16 default NULL year smallint 6 default NULL isbn char 13 NOT NULL default PRIMARY KEY isbn KEY author author 2O KEY title title 2O KEY category category 4 KEY year year FULLTEXT KEY author_2 author title ENGINE MyISAM DEFAULT CHARSET latin1 This is smart code that can be used to restore a database from a backup even if it currently exists because it will first drop any tables that need to be recreated thus avoiding potential MySQL errors. Should you wish to back up only a single table from a database such as the classics table from the publications database you could use a sequence of commands such as those in Example 9-9 in which you simply follow the database name with that of the table to be backed up. I ve assumed here that you haven t shut down the MySQL server. You re letting it run while you back up the classics table but you lock that single table during the backup so that no one can access it. Example 9-9. Dumping just the classics table from publications mysql -u user -ppassword mysql LOCK TABLES classics READ mysql QUIT mysqldump -u user -ppassword publications classics mysql -u user -ppassword mysql UNLOCK TABLES mysql QUIT Or if you want to back up all your MySQL databases at once including the system databases such as mysql you can use a command such as the one in Example 9-10 which would make it possible to restore an entire MySQL database installation remembering to use .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.