Jump to content

#1045 - Access denied for user ‘root’@’localhost’ (using password: YES)

Little background: I used digital ocean to create a wordpress site. 
I used the one click install they provided on their page and now my wordpress site is running. 
And I followed this guide to do some preparation: 

https://www.digitalocean.com/community/tutorials/how-to-use-the-wordpress-one-click-install-on-digitalocean#next-steps

 

And then I followed the last step where they teach you how to install phpMyadmin GUI. 
(this article): 
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04

 

However after installing it I cannot log into it, neither from the GUI nor from command line works. 
Both of them gave me this error: 

Quote

#1045 - Access denied for user 'root'@'localhost' (using password: YES)

I did a simple google search and I found that I need to edit this file: 
config.inc.php 
And manually add in mySQL password. 

But I cannot find this file on my Ubuntu server... Where can I find it and can I edit it inside terminal? 
If so, how to do that ? 

I key in pwd in terminal it shows me i am at root. But ls gives me nothing. 
How do I edit that file then? 

Thanks in advance.

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

Link to comment
Share on other sites

Link to post
Share on other sites

You could install mlocate than run updatedb, than search everywhere for the file.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, mrchow19910319 said:

But I cannot find this file on my Ubuntu server... Where can I find it and can I edit it inside terminal? 
If so, how to do that ? 

I key in pwd in terminal it shows me i am at root. But ls gives me nothing. 
How do I edit that file then? 

Thanks in advance.

Is the webserver running as the user "root"? (it shouldn't be, that is a massive security no-no :))

The config.inc.php file for phpmyadmin is located in /etc/phpmyadmin/

 

edit it with vi or vim (ESC then enter " :wq " to save and exit
 

Intel i7 5820K (4.5 GHz) | MSI X99A MPower | 32 GB Kingston HyperX Fury 2666MHz | Asus RoG STRIX GTX 1080ti OC | Samsung 951 m.2 nVME 512GB | Crucial MX200 1000GB | Western Digital Caviar Black 2000GB | Noctua NH-D15 | Fractal Define R5 | Seasonic 860 Platinum | Logitech G910 | Sennheiser 599 | Blue Yeti | Logitech G502

 

Nikon D500 | Nikon 300mm f/4 PF  | Nikon 200-500 f/5.6 | Nikon 50mm f/1.8 | Tamron 70-210 f/4 VCII | Sigma 10-20 f/3.5 | Nikon 17-55 f/2.8 | Tamron 90mm F2.8 SP Di VC USD Macro | Neewer 750II

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Fetzie said:

Is the webserver running as the user "root"? (it shouldn't be, that is a massive security no-no :))

So is hard coding a password in a file.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×