Mysql – installing thesql via apt-get with non-default data and logs directories

aptMySQLpaths

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.

Best Answer

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.

Related Topic