zoukankan      html  css  js  c++  java
  • CentOS-6.5下portal连接mysql失败,报permission denied

    (1)查看httpd日志

    [root@xiaofeibao ~]# cd /etc/httpd
    [root@xiaofeibao httpd]# ll
    总用量 8
    drwxr-xr-x. 2 root root 4096 8月 30 11:14 conf
    drwxr-xr-x. 2 root root 4096 8月 22 15:08 conf.d
    lrwxrwxrwx. 1 root root 19 8月 22 15:04 logs -> ../../var/log/httpd
    lrwxrwxrwx. 1 root root 29 8月 22 15:04 modules -> ../../usr/lib64/httpd/modules
    lrwxrwxrwx. 1 root root 19 8月 22 15:04 run -> ../../var/run/httpd
    [root@xiaofeibao httpd]#
    [root@xiaofeibao httpd]#
    [root@xiaofeibao httpd]# cd logs
    [root@xiaofeibao logs]# ll
    总用量 1036
    -rw-r--r--. 1 root root 126671 8月 30 11:44 access_log
    -rw-r--r--. 1 root root 900651 8月 30 11:40 error_log
    -rw-r--r--. 1 root root 0 7月 26 01:00 ssl_access_log
    -rw-r--r--. 1 root root 19197 8月 30 11:37 ssl_error_log
    -rw-r--r--. 1 root root 0 7月 26 01:00 ssl_request_log

    (2)查看用户、组

    [root@xiaofeibao logs]# cat /etc/passwd

    [root@xiaofeibao html]# cat /etc/group

    (3)更改文件的所有者

    [root@xiaofeibao html]# chown -R apache:apache portal/
    [root@xiaofeibao html]# ll
    总用量 20
    -rw-r--r--. 1 root root 31 7月 26 01:33 phpinfo.php
    drwxr-xr-x. 12 root root 4096 7月 27 01:00 phpmyadmin
    drwxrwxrwx. 10 apache apache 4096 8月 30 10:42 portal
    -rw-r--r--. 1 root root 334 8月 24 15:25 redis.php
    drwxrwxrwx. 13 root root 4096 8月 25 14:11 test

    (4)查看portal日志

    [root@xiaofeibao log]# tail -f 20170830.txt
    2017-08-30 11:20:50 /portal/index.php/BaseAppIndexServiceTr/testBbc SQLSTATE[HY000] [2002] Permission denied

    参考连接:

    http://blog.csdn.net/eclothy/article/details/48265445

    (5)selinux关闭

    [root@xiaofeibao logs]# vim /etc/selinux/config

    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of these two values:
    # targeted - Targeted processes are protected,
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    修改完成后,保存重启,重启后状态如下:

    [root@xiaofeibao ~]# sestatus
    SELinux status: disabled

  • 相关阅读:
    【Appium】appium踩坑记录:解决每次安装appium setting和Unlock
    Pycharm from XXX import XXX 引入本地文件标红报错(source_path&Python package)
    🍖02 不同平台更换pip源
    🍖pycharm 更换 pip 下载源
    🍖01 路飞学城项目分析
    🍖Vue-cli 创建项目
    🍖Vue 与后端交互
    🍖Vue 计算属性
    🍖Vue 虚拟DOM与Diff算法简介
    🍖Vue 生命期钩子
  • 原文地址:https://www.cnblogs.com/choucat/p/7452450.html
Copyright © 2011-2022 走看看