So I was trying to figure out how to write an automated backup script for php on a shared webhost to execute using mysqldump, with no root access to core php.ini or mysql config on the remote database server, no decent access above "true" web root (just .htaccess mods) and no automated backup protection other than command line.
Apparently it's possible to run
mysqldump with passwords hidden in a defaults file, but only in a specifically named
my.cnf with an odd
--defaults-group-suffix syntax which only works for
mysqlnd), and neither can be used with
mysqlnd/PDO, which (in true Kafkaesque fashion) "no longer allows you" to set a default config file at the mysql level.
Instead it has to
parse_ini_file the same .cnf file, and does not read any default option files.
mysqlnd apparently does not take any config files as argument.
Everything I read tells me not to use the "default" connection args as command arguments.
HOST.cnf, does PDO simply pipe that to
mysqlndarguments in plaintext as a (linux process) command? (as arguments)
Can I have a single config file with two database connections if I list each separately
using mysqldump's default prefix optionand then
parse_ini_filein PHP to pick the right one? *
Is there any point to hiding the PDO connect args in a config file if they are piped to
mysqlndin plain text? (Given how strenuously it is argued against doing the same in
*Edited: nope, can't even do that, neither
--defaults-group-suffix. Do I have to use a separate
.cnffile per-host to share with both