Access denied for user 'root'@'localhost' after installing phpmyadmin on ubuntu
This error can be fixed, the following command will reconfigure your phpMyAdmin credentials to gain access to the MYSQL DB:
sudo dpkg-reconfigure phpmyadmin
/!\ This will provide few interactive menus that will allow you to reconfigure the phpMyAdmin package with NEW credentials /!\
But you could also reconfigure it manually :
1 - Log into mysql as root
mysql -u root -p
2 - Make sure 'phpmyadmin' user exists :
SELECT User FROM mysql.user;
3 - Switch to the appropriate MYSQL DB :
use phpmyadmin;
4 - Set new password for the phpmyadmin user
UPDATE user SET password=PASSWORD('yourNewPassword') WHERE User='phpmyadmin';
Access denied for user 'root'@'localhost' with PHPMyAdmin
Edit your phpmyadmin config.inc.php file and if you have Password, insert that in front of Password in following code:
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
MySQL Error: : 'Access denied for user 'root'@'localhost'
- Open and edit
/etc/my.cnf
or/etc/mysql/my.cnf
, depending on your distribution. - Add
skip-grant-tables
under[mysqld]
- Restart MySQL
- You should be able to log in to MySQL now using the below command
mysql -u root -p
- Run
mysql> flush privileges;
- Set new password by
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
- Go back to /etc/my.cnf and remove/comment skip-grant-tables
- Restart MySQL
- Now you will be able to login with the new password
mysql -u root -p
xampp localhost phpmyadmin Access denied for user 'root'@'localhost' (using password: YES)
Don't change anything , put as it was there , just open your xampp and try to access mysql from shell cd c://xampp/mysql/bin after this write
mysql
and click enter it will open your databases
Related Topics
How to Force Users to Access My Page Over Https Instead of Http
Laravel: Using Try...Catch with Db::Transaction()
PHP - Get Key Name of Array Value
Creating Anonymous Objects in PHP
How Can One Run Multiple Versions of PHP 5.X on a Development Lamp Server
Trying to Get Laravel 5 Email to Work
How to Delete Object from Array Inside Foreach Loop
PHP Sessions with Disabled Cookies, Does It Work
Finding the PHP File (At Run Time) Where a Class Was Defined
How to Export a SQL Table Without Access to the Server or PHPmyadmin
Setup Http Expires Headers Using PHP and Apache
Autoloading Classes in PHPunit Using Composer and Autoload.Php
Calling a Particular PHP Function on Form Submit
Disabling Strict Standards in PHP 5.4
How to Store and Retrieve Image Contents from the Database Using Laravel