Scenario:
Often as DBAs have to run delete, update or insert statements on a table, it is always good idea to take the backup of a table before running any DML statements. Below syntax can be used to take the backup of a table in MySQL Server. mysqldump will create the file which will have drop table, create table and then insert statements for each line. If your table is huge, it can take long time to take the backup and also restore can be lengthy process.
Syntax:
mysqldump --user=username --password=ProvidePassword --lock-tables DatabaseName TableName > /tmp/FileName.sql
mysqldump --user=username --password=ProvidePassword --lock-tables DatabaseName TableName > /tmp/FileName.sql
Example:
If I have a database name TechBrothers and one of the table is Emp that I need to take backup in tmp direcotry, I can use below script.
mysqldump --user=root --password=PasswordforRoot --lock-tables DBA Emp > /tmp/Emp.sql
In above example, I have used root user, you can use the any user which has permission to take backup.
MySQL DBA Tutorial - Take backup of single table from MySQL Server Database
mysqldump --user=root --password=PasswordforRoot --lock-tables DBA Emp > /tmp/Emp.sql
MySQL DBA Tutorial - Take backup of single table from MySQL Server Database
Aivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ bao nhiêu tiền
vé máy bay từ mỹ về việt nam
giá vé máy bay từ nhật bản về việt nam
chuyến bay từ frankfurt đến hà nội
vé máy bay từ canada về việt nam
Máy bay từ Hàn Quốc về Việt Nam
danh sách khách sạn cách ly
vé máy bay cho chuyên gia nước ngoài
Keep sharing about it, you can also explore out best adv helmet 2021 for more features.
ReplyDelete