Why was this disabled? I use Trellis to run multiple WP sites on one host and find using the root account to manage dumps and other maintenance tasks much easier than managing multiple user accounts. This is especially true during development. I can understand disabling root access on a production server but would like the option to override that behaviour.
Ok, sorry for the above comment. I read through everything and found out that this is default MariaDB behaviour and nothing to do with Trellis.
As others have mentioned in other posts this is due to the root login using the auth plugin unix_socket. You can restore the old root password login behaviour following this post:
I donât know Ansible well enough to setup to run a script during provisioning but I imagine that itâs possible.
What I ended up doing to get my backup scripts running again quickly was to just add another mysql user with full privileges. I just added this:
Probably not the best idea from a security perspective I but I donât see it as any worse than before when mysql root password logins were allowed. And since I only allowed local access to the db.
Another example is db_name and db_user. We always documented and recommended the use of the site name for these values. So if your site is named roots.io then it makes sense to have a database called roots_io_production and a user called roots_io (MySQL doesnât like dots).