How do I backup a MySQL database using just queries?
I mean, PHP’s system() function is disables for security reasons, thus I cannot invoke mysqldump.
For table structure I use this:
SHOW CREATE TABLE table_name
But how about table data? Does a predefined SQL command exist? I tried with SELECT ... INTO var_list, but I cannot get this to work (SELECT ... INTO OUTFILE is not suitable for me, as the db host is different from the server I have access to).
Thanks for your help, and sorry for being such a noob, but this is my first question here! 🙂
It should be pretty straightforward to create
INSERTstatements in your PHP code from aSELECT * FROM tablequery. Here’s an example: