当前位置:网站首页>MySQL command backup

MySQL command backup

2022-06-25 02:28:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

1、mysql Command backup (1) Backup test Data and structure mysqldump –opt -h127.0.0.1 -uroot -p111111 –lock-all-tables=true –result-file=”D:\test\test.sql” –default-character-set=utf8 “test” (2) Backup test data mysqldump -t -h127.0.0.1 -uroot -p111111 –lock-all-tables=true –result-file=”D:\test\test_data.sql” –default-character-set=utf8 “test” (3) Backup test structure mysqldump -d -h127.0.0.1 -uroot -p111111 –lock-all-tables=true –result-file=”D:\test\test_structs.sql” –default-character-set=utf8 “test” (4) Backup test trigger mysqldump –opt -t -d -h127.0.0.1 -uroot -p111111 –lock-all-tables=true –result-file=”D:\test\test_triger.sql” –default-character-set=utf8 “test”

2、 Full backup bat file Take full backup data and structure as an example : bat The documents are as follows :

@echo off cd C:\Program Files\MySQL\MySQL Server 5.6\bin mysqldump –opt -h127.0.0.1 -uroot -p111111 –lock-all-tables=true –result-file=”D:\test\%date:~0,4%.sql” –default-character-set=utf8 “test”

For scheduled full backup , have access to windows The scheduled task of is executed regularly bat file .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151762.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242246018185.html