这是我所做的:
user@name /my/path # mysql -u root -p<myPassword>
mysql> create database spy;
ERROR 13 (HY000): Can't get stat of './spy' (Errcode: 13 - Permission denied)
我该如何修复它?
注意到这也会发生:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
ERROR 29 (HY000): File './mysql/user.MYD' not found (Errcode: 13 - Permission denied)
答案1
这是因为mysql用户无权访问您的数据目录。请执行以下命令来修复此问题:
sudo chown -R mysql:mysql /var/lib/mysql
笔记 :我假设你的数据目录是/var/lib/mysql。