phpmyadmin: Access denied for user 'root'@'localhost'

New to Debian (Or Linux in general)? Ask your questions here!

Re: phpmyadmin: Access denied for user 'root'@'localhost'

Postby Lysander » 2017-08-22 09:05

dasein wrote:"That" = the #5 hit at Google using the exact search that I pointed you to two days ago, but you were too farqing lazy even to click.


Just to confirm, this is, in fact, the #4 hit for me when I click on the link in the second post [since Google displays result order differently per user] - even higher. The OP did say the following:

Believe or not, but I did search google (did not take me hours) and got the same list of answers you were so kind to post


That's weird, because if he got the same list of answers previously, he already would have come across that link, but yet, it was untried by him. He says he only tried the first link in the results generated. Everything points to insufficient research.

Let's face it, this thread has turned into a bit of a strudel but it does exhibit an important lesson about the importance of thorough user research. Objectively, dasein's original reply was critical but also helpful [if heeded] because the link the OP needed was indeed part of that he posted [which he said he already tried, and if he had clicked it, it would have appeared a second time for him]. As a result, the thread became unnecessarily circular.

Still, I'm glad the OP got his problem sorted.

EDIT: I didn't realise that all dasein did was Google the exact topic title. None of this needed to happen.
User avatar
Lysander
 
Posts: 558
Joined: 2017-02-23 10:07
Location: London

Re: phpmyadmin: Access denied for user 'root'@'localhost'

Postby Jarry » 2017-08-22 17:15

Lysander wrote:That's weird, because if he got the same list of answers previously, he already would have come across that link, but yet, it was untried by him. He says he only tried the first link in the results generated. Everything points to insufficient research.

Yes, you are right. I tried only the 1st link, and got stuck. Not because it did not work, but because I had doubts doing something like that (as I mentioned previously, that "solution" required to write root's password in file that is globally readable!). It might work, but I considered it dangerous. That's why I asked here. No, I did not try the 2nd, 3rd, 4th, not even the milionth link. Google is usually pretty good in putting the right answer at the top (but not in thise case).

I'm new to Debian, but not to Linux generally. I'm running a few lamp-installations and had no problem with root's passwd (true, there's older mysql, I did not catch that 5.5->5.7 change). Ppl like dasein can not surprise me. I don't care of barking. But those like him make to Debian (and Linux in general) more harm than good...
Jarry
 
Posts: 4
Joined: 2017-08-19 17:55

Re: phpmyadmin: Access denied for user 'root'@'localhost'

Postby jheaton5 » 2017-08-23 14:55

I never login to mariadb from phpmyadmin as root. in a terminal I logged in to mariadb as root. I created a user and granted all privileges with grant privilege. When I login to phpmyadmin, I use the regular user name I created.
debian sid
User avatar
jheaton5
 
Posts: 1489
Joined: 2008-08-20 01:40
Location: Newnan, GA, USA

Re: phpmyadmin: Access denied for user 'root'@'localhost'

Postby n4mu » 2018-01-07 17:03

So much for "you searched, honest."

Lazy, lyin', Oedipus-wannabe


Seriously, replies like this make go the extra mile to sign up and everything (although I probably already have/had an account here that I can't remember), just to say, you are the reason that traditional forums are being replaced by StackExchange type websites. You also contribute to the fact that "Google searches" also come up with threads like this, which are of no use to anyone.

That said, the reply that you claim "works" does not work. It invites users to create a separate user not called 'root' and then give it the same exact privileges. IMHO, it's backwards.

If you want to allow access for user 'root' via PhpMyAdmin all you need to do is change the 'plugin' row/value for user root in the 'mysql' DB. Here's a step by step howto:

1. Connect to MySQL/MariaDB as root and select 'mysql' database

Code: Select all
server$ mysql -u root -p mysql


2. Change the value for "plugin" for the user 'root'

Code: Select all
MariaDB [mysql]> update user set plugin='' where user='root';


3. Flush privileges

Code: Select all
MariaDB [mysql]> flush privileges;



Now, because some consider that this is not secure, you can always revert back, just do as above and replace set 2 with:

Code: Select all
MariaDB [mysql]> update user set plugin='unix_socket' where user='root';



This can be useful for those that would like to use PhpMyAdmin as root temporarily. It's better than just bypassing security with a different user that will have the same permissions and which will remain forever. And ever.


Bye.
n4mu
 
Posts: 1
Joined: 2018-01-07 16:42

Previous

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable