zoukankan      html  css  js  c++  java
  • ERROR 1018 (HY000): Can't read dir of './cmp/' (errno: 13)

    1、错误描述

    root@localhost 15:54:  [cmp]> show tables;
    ERROR 1018 (HY000): Can't read dir of './cmp/' (errno: 13)
    root@localhost 15:54:  [cmp]> show tables;
    ERROR 1018 (HY000): Can't read dir of './cmp/' (errno: 13)
    
    root@localhost 16:01:  [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | cmp                |
    | mysql              |
    | student            |
    | test               |
    +--------------------+
    5 rows in set (0.00 sec)
    
    root@localhost 16:02:  [(none)]> drop database cmp;
    ERROR 1008 (HY000): Can't drop database 'cmp'; database doesn't exist
    root@localhost 16:02:  [(none)]> create database cmp;
    ERROR 1006 (HY000): Can't create database 'cmp' (errno: 13)
    root@localhost 16:02:  [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | cmp                |
    | mysql              |
    | student            |
    | test               |
    +--------------------+
    5 rows in set (0.00 sec)
    
    [yhd@localhost 桌面]$ mysql -uroot -p
    Enter password: 
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    [yhd@localhost 桌面]$ 
    
    [yhd@localhost 桌面]$ mysql -uroot -p
    Enter password: 
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    [yhd@localhost 桌面]$ service mysqld start
    Starting MySQL. ERROR! Manager of pid-file quit without updating file.

    2、错误原因

         在CentOS系统上,创建和删除数据库cmp,但是数据库目录权限被限制了,导致出现这个错误


    3、解决办法

          修改mysql数据库目录文件权限

    chown -R mysql:mysql /data/mysql

  • 相关阅读:
    整除理论
    洛谷P1440 求m区间内的最小值
    洛谷 P1865 A % B Problem
    CF776B Sherlock and his girlfriend
    POJ2262 Goldbach's Conjecture
    BZOJ1607: [Usaco2008 Dec]Patting Heads 轻拍牛头(筛法思想)
    质数合数相关
    CPU缓存会分为一级缓存L1、L2、L3
    mysql+redis
    IntelliJ IDEA下的使用git
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313827.html
Copyright © 2011-2022 走看看