MySQL to MySQL clone with PHP

Does anyone know a PHP script that will clone an entire MySQL database to another on another server? How kind of backup?

+3
source share
3 answers

You will have a PHP script running (e.g. exec () or system () call), e.g.

mysqldump -q -C --databases mydatabase | mysql -C -h othermachine 

Add appropriate flags to these commands to specify credentials, etc.

+6
source

phpMyAdmin does it very well. Of course, if you have shell access, try this instead:

 mysqldump -u [username] -p [password] [database] > [filename] 
+6
source

You can refer to this link. -

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

This page is called

MYSQL DUMP - database backup program

It contains all the details.

Hope this helps you.

+1
source

Source: https://habr.com/ru/post/889807/


All Articles