L
L
Leonid2016-06-16 10:34:22
PHP
Leonid, 2016-06-16 10:34:22

How to run through exec () in PHP the mysqldump utility in Denwer'e?

There is a site running on Denwer , in its admin panel you need to add the function of backing up some tables of its database to a file. Naturally, I'm not going to develop a bicycle, I want to use the functionality of the mysqldump utility
from a PHP script : \usr\local\mysql-5.5\bin\mysqld.exe , launching it with the parameters I need via exec() Questions:

  • how to get to this utility \usr\local\mysql-
    5.5\bin\mysqld.exe on a Windows machine under Denwer through the command in the exec() php function
  • and how to specify the path to the mysqldump utility to save the file, so that for example the file is saved next to my php script from which I do all this

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2016-06-16
@easycode

Well, write the full path in the script to mysqldump and forward. Well, find it through the search, if you don’t find it)))
Only this is a perversion, the site will always work not under Windows.

Y
Yuri Chudnovsky, 2016-06-16
@Frankenstine

And why pervert with the call of the console tool, if everything can be done by the forces of the puff?
https://davidwalsh.name/backup-mysql-database-php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question