Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

php - 无法修改config.inc.php(Can not modify config.inc.php)

I changed password in phpmyadmin for root (there was no password actually) and now when I go to phpmyadmin, I receive this error:

(我在phpmyadmin中更改了root密码(实际上没有密码),现在当我进入phpmyadmin时,收到此错误:)

MySQL said: Documentation

(MySQL说:文档)

Cannot connect: invalid settings.

(无法连接:设置无效。)

mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection.

(mysqli_real_connect():(HY000 / 1045):用户'root'@'localhost'的访问被拒绝(使用密码:NO)phpMyAdmin尝试连接到MySQL服务器,并且服务器拒绝了连接。)

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.

(您应该检查配置中的主机,用户名和密码,并确保它们与MySQL服务器管理员提供的信息相对应。)

I went to config.inc.php to add the password there, but I can't save modified config.inc.php, it shows that I don't have enough permissions to save it.

(我去config.inc.php在此处添加密码,但是我无法保存修改后的config.inc.php,这表明我没有足够的权限来保存它。)

I went to google and searched for issues.

(我去谷歌搜索问题。)

I tried to change permission through terminal with 644, but it didn't work for me.

(我试图用644更改终端的权限,但对我来说不起作用。)

I even tried to reinstall XAMPP, but I still get the same error.

(我什至尝试重新安装XAMPP,但仍然出现相同的错误。)

Now I have phpmyadmin on my computer, which doesn't work at all and I can't change it.

(现在,我在计算机上安装了phpmyadmin,它根本无法工作,并且无法更改。)

Please help me, how can I fix it?

(请帮助我,我该如何解决?)

Also I am using Mac and XAMPP.

(我也在使用Mac和XAMPP。)

  ask by DrueTrue translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Looks like when we install Xampp on mac it and try to use it's terminal, it won't work nano by default.

(看起来当我们在Mac上安装Xampp并尝试使用它的终端时,默认情况下它将无法使用nano。)

I have done below step which works for me.

(我已经完成了对我有用的以下步骤。)

  1. Open terminal window (not mac default terminal please check attached image)

    (打开终端窗口(不是Mac默认终端,请检查附件图像)) 在此处输入图片说明

  2. Then Run apt-get update in the newly opened terminal.

    (然后在新打开的终端中运行apt-get update 。)

    This will update some internal dependencies such as

    (这将更新一些内部依赖项,例如)

      Get:1 http://security.debian.org stretch/updates InRelease [94.3 kB] Get:3 http://security.debian.org stretch/updates/main amd64 Packages [475 kB] Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB] Get:5 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B] Get:6 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [7090 kB] Get:7 http://security.debian.org stretch/updates/main Translation-en [210 kB] Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main Translation-en [5388 kB] Fetched 13.4 MB in 54s (245 kB/s) Reading package lists... Done 
  3. Then run apt-get install nano this will install nano

    (然后运行apt-get install nano这将安装nano)

     Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: spell The following NEW packages will be installed: nano 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 485 kB of archives. After this operation, 2092 kB of additional disk space will be used. Get:1 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 nano amd64 2.7.4-1 [485 kB] Fetched 485 kB in 3s (130 kB/s) perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = (unset) are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package nano. (Reading database ... 13080 files and directories currently installed.) Preparing to unpack .../nano_2.7.4-1_amd64.deb ... Unpacking nano (2.7.4-1) ... Setting up nano (2.7.4-1) .. 
  4. CD to cd ../opt/lampp/phpmyadmin

    (CD到cd ../opt/lampp/phpmyadmin)

  5. Open/Edit nano config.inc.php and save.

    (打开/编辑nano config.inc.php并保存。)

This way it worked for me :)

(这样对我有用:))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...