1、查看数据存储位置
show variables like '%datadir%';
2、备份
@echo off
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
"C:/Program Files/MySQL/MySQL Server 8.0/bin/mysqldump" --opt -u root --password=23456 mybooks > E:/db_backup/mybooks_%Ymd%.sql
@echo on
1、查看数据存储位置
show variables like '%datadir%';
2、备份
@echo off
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
"C:/Program Files/MySQL/MySQL Server 8.0/bin/mysqldump" --opt -u root --password=23456 mybooks > E:/db_backup/mybooks_%Ymd%.sql
@echo on