Cant login to phpmyadmin "#2002 - No such file or directory" and " Connection for controluser as defined in your configuration failed"
So I managed to solve it. Im not quite sure what caused the error in the first place. But I noticed that I couldnt log on to mysql via the terminal either. I got a #1698 - Access denied for user 'root'@'localhost'
error.
So what I did was that I created a new user
create user 'phpmyadmin'@'localhost' identified by 'mypass';
But this gave me the error: ERROR 1396 (HY000): Operation CREATE USER failed for 'phpmyadmin'@'localhost'
So I found a thread which said that we should "assume" that this user already exists. So what I did was:
mysql> drop user 'phpmyadmin'@'localhost';
Query OK, 0 rows affected (0,00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0,00 sec)
mysql> create user 'phpmyadmin'@'localhost' identified by 'mypass';
Query OK, 0 rows affected (0,00 sec)
mysql> grant all privileges on *.* to 'phpmyadmin'@'localhost' with grant option;
Query OK, 0 rows affected (0,00 sec)
mysql> flush privileges;
After this I could log into phpmyadmin with this user.
Related videos on Youtube
mrfr
Updated on September 18, 2022Comments
-
mrfr over 1 year
I've tried to comment out
$cfg['Servers'][$i]['controluser'] = $dbuser; $cfg['Servers'][$i]['controlpass'] = $dbpass;
these two lines in my
config.inc.php
file.I uncommented these lines:
$cfg['Servers'][$i]['controlhost'] = '127.0.0.1'; $cfg['Servers'][$i]['controlport'] = '80'; $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'pmapass';
and put in 127.0.0.1 and port 80.
When I installed mysql i did
mysql_secure_installation
and set up a root user with all privliges (I can log into this user via commandline). So that shouldt be the problem, right?I dont really know what to troubleshoot for. I've looked at all the other links with the same issue but none helped.