du8828 2018-10-22 15:13
浏览 524

无法编辑config.inc.php

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.

enter image description here

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!

  • 写回答

1条回答 默认 最新

  • du_1993 2018-10-23 14:08
    关注

    I was able to resolve this by accessing the config.inc.php file via the terminal provided by xampp.

    enter image description here

    First things first, the xampp-provided terminal needed nano (to edit the file) installed.

    apt-get update
    apt-get install nano
    

    I then navigated to the file:

    cd ../opt/lampp/phpmyadmin
    

    Then opened the file with nano:

    nano config.inc.php
    

    This finally allowed me to edit the config.inc.php file and successfully save.

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题