: This article describes how to use the exec function to import and export a database in php. if you are interested in the PHP Tutorial, refer to it. Export database code:
Exec ("mysqldump-h localhost-uroot-ppassword -- default-character-set =
To export the database code:
EXEC ("mysqldump-h localhost-uroot-ppassword--default-character-set=utf8 dbname>d:/aaa.sql 2>&1", $output , $return _val); exit;
Note: 1) between-H and localhost to have a space (otherwise the output will be reported
More community recently, considering the security of data, to backup the database once a day, just in case;Linux is not very well known, first use the windows of the scheduled task it;The general idea is to borrow a scheduled task from Windows to
exec function
EXEC ("/usr/bin/mysqldump-h ' 210.14.65.107 '-uroot-ppsswd AM | gzip >/var/www/html/s/dase.sql.gz ");
This code on the Linux server, I directly connect the server with php/var/www/html/s/2.php to execute this PHP success.
But under
Linux environment: Debian 6 Stable
Program Version selection:
Nginx:tengine 1.2.4Taobao produced, based on Nginx and introduced a number of new features
mysql:5.1.66The latest version of the 5.1 series. The reason for not 5.5 is that 5.5 started
Windows: scheduled PHP execution and windowsphp. Windows: regular execution of PHP skills; windowsphp skills: regular execution of PHP in windows I believe many readers (PHP fans) often complain about the following during their work and study
I believe many readers (PHP fans) often complain during their work and study: how can we enable PHP to send messages automatically at regular intervals in WIN ?? How can I enable MYSQL to achieve automatic backup without any worries ?? If you rely
Use scheduled tasks in Windows to automatically execute PHP program instances. The so-called task plan is to use a computer to automatically call the user's preset applications, so as to simplify user operations. The use of Windows2000 Task
Windows timed to execute PHP believe that many readers (PHP enthusiasts) in the work, learning process often complained: in Win how to let PHP timed automatically?? How to allow MySQL to achieve automatic backup without worry?? If you rely entirely
PHP programs run automatically and tasks are scheduled in windows. If you want the PHP program to run automatically in windows, you must use the windows scheduled task. next I will introduce the implementation method to you. Specifically, if you
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.