With MariaDB by default the root user has the plugin unix_socket enabled:
SELECT Plugin FROM user WHERE User = "root";
+-------------+
| Plugin |
+-------------+
| unix_socket |
+-------------+
From the documentation:
This is useful. However we also run PHPMyAdmin which requires the root username and password entering to connect to MariaDB, and this login is failing because the root user has the unix_socket plugin specified.
If we remove the unix_socket from the root user, PHPMyAdmin then works with a regular username/password combination, but we also have to enter the username and password each time when connecting to MariaDB from the command line.
Is there a solution where both can be used in-conjunction with each other?
For security we don’t really want to store the root password in plaintext in a ~/.my.cnf file.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Why don’t you create two root
users? As long as the Host
+User
is unique, then it’s allowed.
But from a security point, I would would say /root/.my.cnf
is a clear winner compared to phpMyAdmin.
If you look at how many security flaws there has been in PMA, PHP, Apache and MySQL combined versus the chmod
/chown
commands of the Unix-world, then you wouldn’t doubt how it works.
I’m guessing you’re running PMA over HTTPS, and storing all company passwords in a password manager - if not, then that’s a much bigger security problem.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.