I work on Denver via CMD (Denver because it weighs a little), there are a few questions on Mysql.

  1. How to create a dump of the database "pochta", met requests in Google, but they only work on Linux.
  2. How to make automatic dumping to the c: \ directory every day at 2 am
  3. How to implement the request "Source comand.sql" in a separate comand.bat
  • Как создать дамп БД "pochta", в гугле встретил запросы но они работают только на линуксе. - you wrote the third paragraph source .... it works on windows. Have you tried? ...... 2 point - need CRON (task scheduler) - Alexey Shimansky
  • When I write in the batch file: G: \ usr \ local \ mysql-5.5 \ bin \ mysql.exe -u root source code.sql It just starts mysql and does not execute source code.sql - Fedor
  • source is a client command. He must also say that it must be done - see the key --execute dev.mysql.com/doc/refman/5.7/en/… - Akina
  • Already found: G: \ usr \ local \ mysql-5.5 \ bin \ mysql.exe -u root diplome <code.sql - Fedor
  • Or G: \ usr \ local \ mysql-5.5 \ bin \ mysql.exe -u root <code.sll - Fedor

1 answer 1

How to create a dump database "pochta"

Use mysqldump. Manual .

How to make automatic dumping to the c: \ directory every day at 2 am

Configure the task scheduler of the operating system.

How to implement the request "Source comand.sql" in a separate comand.bat

Start the command line client, passing it the command in the --execute key. Manual .

Or just drive the file to the client through standard input - see ibid., Example 2.

  • I understood the fact that it was mysqldump, but I could not find the syntax, could you write an example - Fedor
  • Well, the very first example in the manual! If authentication is needed, then add the --user and --password keys, for example mysqldump.exe --user=pupkin@localhost --password=superpASS pochta > c:\dumps\pochta.sql - Akina
  • It turned out that there is no such thing in Denver - Fedor
  • Take from the installer of the community-server of the same version, business ...