Is there a way to install mysqld via apt-get and have it a non default path for the data files?
I know I can install it with the defaults and then move stuff (I've done that) but then I have about a dozen different places I need to update things (4-5 in my.cnf, 6-8 for app-armor, and I think there was somethings else that I'm forgetting).
Edit: I'm assuming/hoping that the relevant config files are all generated at install time rather than being hard coded as static content. Assuming that, what I need is a way to have apt-get pass on the flags to adjust the variables used to specify the relevant paths.
You'll have to make your own mysql packages if you want to make them install with special paths just for you. It would be easier to use symlinks or bind mounts to move whatever it is you want to move to wherever it is you want it to go.
Otherwise, your choices are the right way of building a custom package from source and the very, very wrong way of hacking apart an existing package with
ar
, changing all the paths and configuration files, then putting it back together again.All you mentioned was apt, and not any specific distribution.
I just performed a quick inspection of the preinst/postinst scripts on a Debian Lenny mysql-server deb source. These folders are hard coded as part of the included management scripts and default configuration file. There is no magical tool on Debian Lenny, and I suspect others to redirect the data/log folders before the install is done. Debconf is not used in the version of the Mysql package I looked at, but this tool is commonly used to set preferences for other packages.
So the short answer, is that you probably will need to fix things post install. If you grab the package source and take a look at the scripts in
/var/lib/dpkg/info/mysql*
you should get a good idea of what exactly needs to be changed.Depending on your distribution you can perhaps overwrite mysql settings in a file
/etc/mysql/conf.d/...
?