无法编辑config.inc.php [英] Unable to Edit config.inc.php

查看:137
本文介绍了无法编辑config.inc.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行:macOS High Sierra版本10.13.3,带iTerm2的zsh

Running: macOS High Sierra Version 10.13.3, zsh w/ iTerm2

尝试使用 xampp 设置本地环境,过去对我来说效果很好.但是,通过 phpmyadmin 用户界面更改了root密码后,现在无法访问 phpmyadmin .

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.

我正在遵循的教程(建议这样做)将我指向 config.inc.php 文件,该文件中的密码变量也需要更新.不幸的是,我无法编辑此文件.我曾经在Stack Overflow中看到其他用户抱怨过同样的问题,但是返回的答案似乎总是涉及通过 vi nano 进行编辑,但这种方法不起作用对我来说这是使用nano时发生的情况的一个示例.

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.

我通过nano打开文件

I open file via nano

sudo nano config.inc.php

然后,我的终端提示我输入系统密码.

My terminal then prompts me for the system password.

在nano中,我导航到password变量并输入:

Once in nano, I navigate to the password variable and enter it:

$cfg['Servers'][$i]['password'] = '[mypassword]';

然后我尝试使用ctrl + O进行保存,提示输入:

I then attempt to save using ctrl+O, where I'm prompted:

File Name to Write: config.inc.php

,然后按ENTER键后,收到来自nano的错误:

and then after hitting ENTER receive the error from nano:

Error writing config.inc.php: Permission denied

我还尝试通过 Sublime Text 3 编辑文件,在该机器上,机器提示我输入用户密码.这样做之后,我没有收到任何错误消息,但仍然无法访问 phpmyadmin .我无法使用chmod来编辑该文件的权限,并且在编辑 config.inc.php 文件后重新启动mysql服务器也不起作用.

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.

为什么即使我输入了系统密码,nano仍会抛出"permission否认"错误?

Why is nano throwing the "permission denied" error even after I've entered my system password?

谢谢!

推荐答案

我能够通过xampp提供的终端访问config.inc.php文件来解决此问题.

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

首先,xampp提供的终端需要安装nano(用于编辑文件).

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

apt-get update
apt-get install nano

然后我导航到该文件:

cd ../opt/lampp/phpmyadmin

然后使用nano打开文件:

Then opened the file with nano:

nano config.inc.php

这终于使我能够编辑config.inc.php文件并成功保存.

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

这篇关于无法编辑config.inc.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆