The permission to execute mysqldump is intended to achieve the backup of the entire database by clicking the button on the php page $ tmpname & quot; wholesystem. SQL & quot; unlink ($ setupdirection. & quot; tmp $ tmpname & quot;); $ command & quot; mysqldump & nbsp; -- opt & permission for executing mysqldump
Click the button on the php page to back up the entire database.
$ Tmpname = "wholesystem. SQL ";
Unlink ($ setupdirection. "/tmp/$ tmpname ");
$ Command = "mysqldump -- opt -- default-character-set = latin1-u $ dbusername-p ". $ dbuserpass. "$ dbnames> ". $ setupdirection. "/tmp/$ tmpname ";
System ($ command );
Download ($ setupdirection. "/tmp/", $ tmpname, $ tmpname );
The content printed by $ command enters the bin of mysql installation path in the command line. The execution is successful !!
However, with the above code, an empty SQL file is always output.
I know the reason is that mysqldump is directly executed in the command line, instead of internal commands, it must be executed in the bin of the mysql installation path.
Do you have to save the mysql installation path? It will be troublesome to transplant the system later.
Is there any other way to run $ command?
------ Solution --------------------
Considering system migration, you should specify the full path, different systems, or even different installations, and certainly place the commands in different paths, including your target directory, different systems must be different.
We recommend that you use show create table with select into outfile and load data infile.
------ Solution --------------------
I don't know what it means,
How do I need to run it multiple times?
In multiple databases?
Mysqldump-uuser-ppass-h hostname databasename tablename1 tablename2...
In this way, multiple tables can be backed up.