Running: macOS High Sierra Version 10.13.3, zsh w/ iTerm2
Trying to set up a local environment with xampp, which has worked just fine for me in the past. However, I’m now unable to access phpmyadmin after changing the root password via the phpmyadmin UI.
The tutorial I am following (which suggested doing this) pointed me to the config.inc.php file, where the password variable would also need to be updated. Unfortunately, I am unable to edit this file. I’ve seen other users in Stack Overflow complain of the same issue, but the answer that comes back always seems to involve editing via vi or nano, which doesn’t work for me either. Here’s an example of what happens when using nano.
I open file via nano
sudo nano config.inc.php
My terminal then prompts me for the system password.
Once in nano, I navigate to the password variable and enter it:
$cfg['Servers'][$i]['password'] = '[mypassword]';
I then attempt to save using ctrl+O, where I’m prompted:
File Name to Write: config.inc.php
and then after hitting ENTER receive the error from nano:
Error writing config.inc.php: Permission denied
I’ve also tried to editing the file via Sublime Text 3, where my machine prompts me to enter the user password. I receive no error message after doing that, but still cannot access phpmyadmin. I am unable to use chmod to edit permissions on the file, and restarting the mysql server after editing the config.inc.php file also does not work.
Why is nano throwing the “permission denied” error even after I’ve entered my system password?
Thanks!
4
Answers
I was able to resolve this by accessing the config.inc.php file via the terminal provided by xampp.
First things first, the xampp-provided terminal needed nano (to edit the file) installed.
I then navigated to the file:
Then opened the file with nano:
or try
sudo nano config.inc.php
This finally allowed me to edit the config.inc.php file and successfully save.
Great question. I had to work on this for an hour to figure it out too.
Open Xaamp and go to “Open Terminal” on the main page. Make sure the server is running.
You can run “apt-get update” like the other person said above me. The main one you want is “apt-get install nano”
Then do “cd ..” so you can back out of the file. The other person said “cd ../opt/… ” but that command didn’t work for me. What worked was doing “cd ..”
Then do cd again, type in “cd opt/lampp/phpmyadmin”
Then type “nano config.inc.php”
You should now be able to edit it. Hit control + o to save it.
It worked for me. It took me an hour to figure it out.
As I thought, I have the same issue as the above, I tried all the commands and I have changed the config.inc file into these settings :
$cfg[‘Servers’][$i][‘controluser’] = ‘root’;
$cfg[‘Servers’][$i][‘controlpass’] = ”;
But I still end by the same error when I’m acceding to phpmyadmin
Any solutions please ??
Try this to edit the file:
Open terminal from Xampp -> enter
apt-get update
then -> enterapt-get install nano
then -> navigated to the filecd ../opt/lampp/phpmyadmin
-> open the filenano config.inc.php
make changes as you like -> to save, presscontrol + O
andcontrol + M
and to exit ->control + X
You might not need to edit the file to solve the error. just try this:
Open terminal from Xampp -> enter
apt-get update
then -> enterapt-get install nano
then -> navigated to mysql foldercd ../opt/lampp/var/mysql
-> delete these filesrm ib_logfile0
enter and ->rm ib_logfile1
enternow restart Xampp.