Questions about the permission to execute mysqldump

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.