Hi Giovanni,
Thanks for writing, it's always good for us to feel out what's important to the community.
In short, no, phpMyAdmin really isn't mean to be used that way. It used to be that we could pass some authentication tokens (username and password as POST values or through cookies), but changing security threats have meant that a lot of the easier/more scripting-friendly methods have been phased out.
For a long time, phpMyAdmin has been intended to run as an interactive graphical interface, and while I'm not forcefully against some web server interface or exposing an API, planning, developing, and safely implementing that has been pretty far outside the scope of what we have development resources to pursue.
Regards, Isaac
On Thu, Oct 17, 2024 at 7:34 AM team@focuslab.it wrote:
Hello developers, and congratulations for the excellent work being done here ...
I don't know anyone has ever had this need, but I'll try to pose the question:
is it possible to call the phpmyadmin table export functionality via a php script, through the curl command, to export MySql db tables without having to use the phpmyadmin interface?
I did some tests but, although php doesn't give me any errors, the exported .sql file is always empty (and no phpmyadmin errors are caught).
I'm calling curl on the page, https://localhost/phpmyadmin/libraries/classes/export.php to which I pass (via curl options) authentication credentials, the name of the db and the table to export; (I have doubts about how to pass the token, if requested by script, but I would expect at least some authentication errors from phpmyadmin, and instead no errors...)
I know that normally for this purpose I can use other main methods, like
- export directly from a php script or 2) use mysqldump, but with the
first method (php script) I don't get a precise and complete export like the one done by phpmyadmin (and this then causes me problems restoring the data), and for the second (mysqldump) the provider that manages the server prevents me, for security reasons, use exec() from php code; and also I can't just use a cron procedure to use mysqldump, as I would like to be able to export the db tables on demand.
So I'm looking for alternative ways to export the MySql db in the optimal way as phpmyadmin does, and so I thought about using phpmyadmin as a web service, but I don't know if the idea is viable;
thanks in advance to anyone with any advice;
Giovanni _______________________________________________ Developers mailing list -- developers@phpmyadmin.net To unsubscribe send an email to developers-leave@phpmyadmin.net