【问题标题】:Can not modify config.inc.php无法修改 config.inc.php
【发布时间】:2018-12-03 04:49:37
【问题描述】:

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

MySQL 说:文档

无法连接:无效设置。 mysqli_real_connect(): (HY000/1045): 用户 'root'@'localhost' 的访问被拒绝(使用 密码:否)phpMyAdmin 尝试连接到 MySQL 服务器,并且 服务器拒绝了连接。你应该检查主机, 配置中的用户名和密码,并确保它们 对应MySQL管理员给出的信息 服务器。

我去config.inc.php那里添加密码,但是修改后的config.inc.php无法保存,说明我没有足够的权限保存。

我去谷歌搜索问题。我尝试使用 644 通过终端更改权限,但它对我不起作用。

我什至尝试重新安装 XAMPP,但仍然遇到同样的错误。

现在我的电脑上有 phpmyadmin,它根本不起作用,我无法更改它。

请帮帮我,我该如何解决?

我也在使用 Mac 和 XAMPP。

【问题讨论】:

  • 你还能访问 PHPMyadmin localhost/phpmyadmin/… 还是不能只从你的应用程序连接?
  • 我无法访问 PHPmyadmin
  • 制作一个关于如何更改密码或如何尝试编辑配置文件的截屏视频。这里有太多未指定的点。这几乎不是一个编程问题,更多的是一个远程支持请求。无休止的来回 cmets 超出范围。
  • 您使用的是 xamp 还是 wamp 服务器?
  • 我正在使用 xampp

标签: php mysql macos phpmyadmin xampp


【解决方案1】:

看起来当我们在 mac 上安装 Xampp 时,它会尝试使用它自己的终端,默认情况下它不会工作 nano。

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

  1. 打开终端窗口(不是mac默认终端,请查看附件图片)
  2. 然后在新打开的终端中运行apt-get update。这将更新一些内部依赖,例如

       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. 然后运行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 转至cd ../opt/lampp/phpmyadmin

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

这种方式对我有用:)

【讨论】:

    【解决方案2】:
    • 打开 Mac 命令外壳。

    • 使用cd 命令将目录设置为config.inc.php 文件所在的位置。

    • 键入以下命令:

      sudo nano config.inc.php
      

      您将被要求输入密码;输入它。这会将命令置于管理员模式。

      这将在命令窗口中打开 Nano 文本编辑器,您可以在其中编辑文件。找到密码字段(如果需要搜索使用ctrl+w),编辑它,然后使用ctrl+x保存并退出。您现在应该可以再次使用 phpMyAdmin。

    【讨论】:

      【解决方案3】:

      我也有同样的问题,请一步步解决这个问题

      1. 在 macOS 上使用 Xampp 打开 CMD
      2. apt-get 更新
      3. apt-get install nano
      4. nano /opt/lampp/phpmyadmin/config.inc.php(并更改密码或其他)
      5. 用 CTRL + O 保存

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-04-21
        • 1970-01-01
        • 2012-01-26
        • 1970-01-01
        • 1970-01-01
        • 2022-11-17
        • 2021-01-16
        • 2017-12-09
        相关资源
        最近更新 更多