Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not login to phpmyadmin with root user

I am having trouble to login to with phpmyadmin in Ubuntu system.

Username - root Password - empty

but still it show me error like below

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

Help me to solve it Thank you.

like image 773
Pooja Mokariya Avatar asked Oct 15 '25 20:10

Pooja Mokariya


1 Answers

I sloved it with below steps:

1) Open config.inc.php file

2) Change file permition to write

sudo chmod 777 /etc/phpmyadmin/config.inc.php

3) Add below line to the file

 $cfg['Servers'][$i]['user'] = 'root';
 $cfg['Servers'][$i]['password'] = 'MY_SQL ROOT_USER_PASSWORD';
 $cfg['Servers'][$i]['AllowNoPassword'] = true;

4) Change file parmissions to original again

 sudo chmod 755 /etc/phpmyadmin/config.inc.php

5) Restart server

service mysql start or service mysql start

6) open

http://localhost/phpmyadmin
username: root
password: YOUR_MYSQL'S ROOT USER'S PASSWORD
  • Successfully logged in to phpmyadmin.
like image 52
Pooja Mokariya Avatar answered Oct 17 '25 13:10

Pooja Mokariya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!