I am trying to search a solution for this problem, but didn't find a solution. I am getting an error while login in phpmyadmin
#1045 Cannot log in to the MySQL server
Connection for controluser as defined in your configuration failed.
I am trying to configure config-db.php and config.inc.php files reside in /etc/phpmyadmin/ directory. There i am changing $dbname and $dbpass in config-db.php as my root user and password but still can't login. After google, i get some clue and uncommented a line in config.inc.php:
/* Uncomment the following to enable logging in to passwordless accounts,
* after taking note of the associated security risks. */
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
These things are so ridiculous, follow articles like Lamp server installation
shows step by step things and i do the same thing, but i get this error thrice times. Even i can't login in mysql through shell.
Please help me to sort out this problem and know the actual reason why this happen when i am enter password twice time while installing mysql.
Best Answer
Try changing your MySQL password:
To reset your mysqld password just follow these instructions :
Start the mysql client process using this command
mysql -u root
From the mysql prompt execute this command to be able to change any password
FLUSH PRIVILEGES;
Then reset/update your password
SET PASSWORD FOR root@'localhost' = PASSWORD('password');
Once have received a message indicating a successful query (one or more rows affected), flush privileges:
FLUSH PRIVILEGES;
Then stop the mysqld process and relaunch it with the classical way:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
Source: https://help.ubuntu.com/community/MysqlPasswordReset
UPDATE:
Lets try updating your current password. Do this:
At this point you get the mysql command shell. You will need to update the root password and flush the table when you reset the password.
Now that you’ve flushed your passwords, just restart your mysql daemon.