![]() "%mysqldir%\bin\mysqldump" -user=?user% -password=?pass% -databases %%f > "%bkupdir%\%fn%_%%f.sql" This one here works but only fails for some with the LOCK TABLES privilege error. "%mysqldir%\bin\mysqldump" -user=?user% -password=?pass% -databases %%f -result-file="%bkupdir%\%fn%_%%f.sql" -single-transaction -quick This one here fails completely creating 0 byte files. Now, when I put that into a loop in a batch, I does not work anymore and my files are all empty. C:> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump" -user=backup -password=backup -databases apps_xyz -result-file="D:\mysql\backup\-14-56_apps_xyz.sql" -single-transaction I have read that dumping with -single-transaction would get rid of the necessity to lock tables and I tried that and it worked. There are, however, also DBs which are all InnoDB and get dumped correctly. The whole backup for this DB in then empty. The script does not work for some databases failing with an error stating the user executing the dump does not have LOCK TABLES (error 1045) privileges for a single table, which he has. For a table named t1, the files are named t1.sql and t1.txt. The table name is the base name for these files. I have a batch looping over all databases in the data dir and creating a backup for each database one by one. If you invoke mysqldump with the -tabdirname option, it uses dirname as the output directory and dumps tables individually in that directory using two files for each table. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |