简体   繁体   English

XAMPP (Windows) 自动备份 MySQL 数据库

[英]XAMPP (Windows) backup MySQL Database Automatically

I am trying to create a batch file in Windows to backup a MySQL Database, i have tried this:我正在尝试在 Windows 中创建一个批处理文件来备份 MySQL 数据库,我试过这个:

C:\xampp\MySQL\bin\MySQLDump –u root –p database_name –result-file=”C:\Users\Administrator\Desktop\MySQLDump.sql”

but i get an error saying:但我收到一条错误消息:

Got error: 1044: Access Denied for user ``@`localhost` to database `?u` when selecting the database

The solution to this problem/error was to use one of these mysqldump commands:此问题/错误的解决方案是使用以下 mysqldump 命令之一:

mysqldump --opt --lock-tables=false -u USER -p DBNAME > dump.sql mysqldump --opt --lock-tables=false -u USER -p DBNAME > dump.sql

mysqldump --opt --single-transaction -u USER -p DBNAME > dump.sql mysqldump --opt --single-transaction -u USER -p DBNAME > dump.sql

http://alvinalexander.com/mysql/mysql-error-1044-access-denied-for-user-using-lock-tables http://alvinalexander.com/mysql/mysql-error-1044-access-denied-for-user-using-lock-tables

Try this, it worked for me.试试这个,它对我有用。 Don't forget to replace values inside {} as you need不要忘记根据需要替换{}

C:\xampp\mysql\bin\mysqldump.exe -u{username} -p{passwrod} database > {/backuppath}.sql

Completed guide can be found at here:完整的指南可以在这里找到:

https://www.tectut.com/2016/04/automatically-backup-mysql-databases-on-windows/ https://www.tectut.com/2016/04/automatically-backup-mysql-databases-on-windows/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM