Install Mysql with data on LVM volume


Is it possible to install mysql with the data on an LVM volume?

My normal procedure on other distirbutions is to mount the volume on /var/lib/mysql prior to installation so that initial database is directly written on the logical volume.

However in 18.04 server the mysql-server installation fails with: “Error occurred: Cannot select database.”

I can see this old issue that seems the cause of the problem:

Has anybody got a workaround?
How is this done properly in Ubuntu?