0

I am using Linux Mint 17.3. I started using XAMPP but had error 2002. That is why I changed my root's password in phpMyAdmin. After that, I couldn't access phpMyAdmin. I got this message:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server

I searched for a solution and found that I have to edit my config.inc.php file in the phpMyAdmin folder. The problem is that I can only read the file, but not edit it. How am I supposed to make this file editable?

Zaz
  • 46,476
  • 14
  • 84
  • 101
Niki Karaolis
  • 65
  • 1
  • 12

1 Answers1

0

The solution is simple. You need to change permission of the file. Start the terminal (You can use Ctrl + Alt + T) and use the following commands:

cd <directory of your config file>
sudo chmod 644 config.inc.php

The file should be editable for you to make changes.

Make sure you restart XAMPP server after saving the changes to the file.

Sujeet Sinha
  • 2,417
  • 2
  • 18
  • 27
  • That has to work. Only problem is that the computer can't find my file. I will try to fix this. If you have any ideas share them, because I am new to linux. – Niki Karaolis Aug 09 '16 at 08:46
  • It should be mostly in `/opt/xampp/phpmyadmin` or `/opt/lampp/phpmyadmin`but depends how and where you installed it... – Sujeet Sinha Aug 09 '16 at 08:49
  • 1
    use `locate config.inc.php` in terminal – Saurabh Aug 09 '16 at 08:50
  • @Saurabh thanks, that gave me an idea.. You can use `find / -name config.inc.php` – Sujeet Sinha Aug 09 '16 at 08:51
  • @NikiKaraolis did that fix your issue?? – Sujeet Sinha Aug 09 '16 at 09:04
  • Yes finally. Thanks a lot. I was able to find the file by myself, but somehow i still got that problem. I reinstalled XAMPP and now i was able to make the config file editable. – Niki Karaolis Aug 09 '16 at 09:12
  • Use the same command but with the values 444 instead. However, I don't think that is needed as the command makes the file editable only for you and no one else.. – Sujeet Sinha Aug 09 '16 at 09:37
  • @SujeetSinha. Yes i figgured it out and actually it is needed. Otherwise i get the message :`Wrong permissions on configuration file, should not be world writable!` – Niki Karaolis Aug 09 '16 at 09:48
  • @SujeetSinha Bad thing is that even after editing my config file and following these instructions:http://stackoverflow.com/questions/1276538/phpmyadmin-cant-connect-invalid-setings-ever-since-i-added-a-root-passwor i still get the error message that i mentioned in the beggining – Niki Karaolis Aug 09 '16 at 09:51