码迷,mamicode.com
首页 > 其他好文 > 详细

ERROR 1018 (HY000): Can't read dir of './shopxo/' (errno: 13 - Permission denied)

时间:2020-09-03 16:57:30      阅读:41      评论:0      收藏:0      [点我收藏+]

标签:show   mysq   验证   enter   mysql   row   centos   database   目录   

环境:
CentOS7.8 64位
MySQL5.7.31

问题:

#查看shopxo库中表的时候报错,权限拒绝
mysql> use shopxo;
Database changed
mysql> show tables;
ERROR 1018 (HY000): Can‘t read dir of ‘./shopxo/‘ (errno: 13 - Permission denied)

排查:

#查看shopxo数据库的权限
[root@201 /var/lib/mysql]# ls -ld /var/lib/mysql/shopxo
drwxr-x--- 2 root root 4096 Aug 25 11:17 /var/lib/mysql/shopxo
#发现目录归属为root

解决办法:

chown -R mysql.mysql /var/lib/mysql/shopxo

验证:

mysql> show tables;
+-----------------------------+
| Tables_in_shopxo            |
+-----------------------------+
| s_admin                     |
| s_answer                    |
| s_app_center_nav            |
| s_app_home_nav              |
+-----------------------------+
4 rows in set (0.00 sec)

ERROR 1018 (HY000): Can't read dir of './shopxo/' (errno: 13 - Permission denied)

标签:show   mysq   验证   enter   mysql   row   centos   database   目录   

原文地址:https://www.cnblogs.com/ccku/p/13560202.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!