Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Found this question when I was trying to get my own Mysql database backed up and thought I'd share how I ended up doing it.</p> <p>The code basically loops over all databases and creates a .sql file containing all structure and data for each database.</p> <pre><code>:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: MySQL Backup :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: MySQl DB user set dbuser=BackupUser :: MySQl DB users password set dbpass=BackUpUserPassWord :: Switch to the MySQL data directory and collect the folder names pushd "C:\Server\databases\mysql\data" :: Loop through the folders and use the file names for the sql files, collects all databases automatically this way :: Pass each name to mysqldump.exe and output an individual .sql file for each FOR /D %%F IN (*) DO ( "C:\Program Files\MySQL\bin\mysqldump.exe" --user=%dbuser% --password=%dbpass% --databases %%F &gt; "C:\Server\backups\mysql\%%F.%TODAY%.sql" ) </code></pre> <p>To answer your specific question, check to see if you are running the script as administrator and that the user you are trying to backup using has relevant privileges to the databases. I was stuck on this very problem until I ran my bat file as administrator.</p> <p>To check if its a user problem, try running the mysqldump with the root user and see if that helps, if it does you know its a problem with database rights..</p> <p>To run as administrator right click the bat file, and select Run as administrator, and don't forget to set the checkbox "run with highest privileges" in the scheduled task if you are using that.</p> <p>Code is copied from here: <a href="http://www.syntaxwarriors.com/2012/backup-up-a-windows-server-using-only-free-tools/" rel="nofollow">http://www.syntaxwarriors.com/2012/backup-up-a-windows-server-using-only-free-tools/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload