• phpmyadmin Wrong permissions on configuration file, should not be world writable!


     巴拉巴拉,实际场景是这样,因为有需要,所以想用django 做个rest服务给其他平台提供服务,发现以前正常的页面都无法运行,奇怪发现有一个页面提示连接不上mysql 难道mysql挂了,打开phpmyadmin 提示如标题,进入到init.d 准备查看下状态 提示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) 咦,mysql 坏了,连接不上了,

    提示大概是这样的

      

    File './mysql-bin.~rec~' not found (Errcode: 13)
    [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open register  file.
    [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the index file.

    找到对应的文件夹,发现还在里面,修改了权限之后发现用sudo 可以把服务启动了,然后回过来刷新,phpmyadmin 依然不行,网上看了下 90%说phpmyadmin 运行需要755权限,修改之后依然不行,真是给跪了。http://www.davinder.in/blog/wrong-permissions-configuration-file-should-not-be-world-writable 后来在这里看到作者写的 果然打开/usr/share/phpmyadmin/libraries/Config.class.php 找到提示语这几行 在1129L 是在

       function checkPermissions()
        {
            // Check for permissions (on platforms that support it):
            if ($this->get('CheckConfigurationPermissions')) {
                $perms = @fileperms($this->getSource());
                if (!($perms === false) && ($perms & 2)) {
                    // This check is normally done after loading configuration
                    $this->checkWebServerOs();
                    if ($this->get('PMA_IS_WINDOWS') == 0) {
                        $this->source_mtime = 0;
                        /* Gettext is possibly still not loaded */
                        /*if (function_exists('__')) {
                            $msg = __('Wrong permissions on configuration file, should not be world writable!9999');
                        } else {
                            $msg = 'Wrong permissions on configuration file, should not be world writable!';
                        }
                        PMA_fatalError($msg);*/
                    }
                }
            }
        }

    直接这几行注释掉,终于进来了。 还有另外一种解决方案:

      

    $cfg['CheckConfigurationPermissions'] = false;

    这个在官网的文档里也有说明,不过在我加上去之后依然没有用,不过可能对其他人有用,这里提下。

    我的原因估计是权限乱掉了,只是我修改了也没啥用,只能走走歪路子了,权限一直挺正常的,预计是上次hadoop出问题之后 修改了一些权限导致的问题,作为一个错误记录下来,在实在是找不到问题的时候这个倒是可以用,因为时间总是有限的不可能在这个错误上耗费太多时间

  • 相关阅读:
    5月14日 游戏闯关,
    无名管道练习小程序
    关于对进程、线程的返回状态的获取的理解
    C语言中内存分布及程序运行中(BSS段、数据段、代码段、堆栈)
    linux 与会话相关的一些概念、登录过程
    linux进程——fork、vfork 两函数的实现及两者区别
    关于 linux 中init 进程
    linux进程——fork()函数
    linux下 vim多屏幕操作
    linux下进程管理
  • 原文地址:https://www.cnblogs.com/EncryptingLife/p/5591203.html
Copyright © 2020-2023  润新知