With Adminer.php I get a Access denied for user 'root'@'localhost' error. Ubuntu 18.04

Access denied for user 'root'@'localhost'

I am getting this error with adminer.php and phpmyadmin won't work either. I am able to run SQL commands in terminal after typing 'sudo mysql'. I have a user table with root as a username but there is no password field.

If anyone can help me to get this to work it would be great.

3 Answers

This solved my problem - can't login as mysql user root from normal user account in ubuntu 16.04

I'm using Ubuntu 18.04 and so these instructions work for me.

write this this command in your terminal with root user

getsebool -a | grep http

and look to httpd_read_user_content if it's off then you have to make it on by this command

setsebool -P httpd_read_user_content on 

then restart your apache server and try to access to adminer and phpmyadmin

2

In newer versions of MariaDB/MySQL the default root user authentication method on Linux is unix socket. In other words, only the root user itself can login to the MySQL root user account (and no password is needed).

As unix socket authentication is the most secure way to authenticate, IMO the best way to go is to create a new root-like user (that does require a password) for use with Adminer (and/or other DB interfaces that require a user is authenticated via password).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like