MySQL chown坏后如何恢复mysql权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13624589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:36:43  来源:igfitidea点击:

How to restore mysql privileges after bad chown

mysqlpermissionscentosroot

提问by HymanTurky

wrongly i set owner on all the files in my server to root :

我错误地将服务器中所有文件的所有者设置为 root :

chown -R root /

now i have some problem with mysql server due to permission.

现在由于许可,我的 mysql 服务器出现了一些问题。

How can i set mysql owner to the correct files?

如何将 mysql 所有者设置为正确的文件?

(I can't reinstall mysql server cause i have important table in my db )

(我无法重新安装 mysql 服务器,因为我的数据库中有重要的表)

回答by Rawkode

On my CentOS box, the own and group is mysqland the install is here. This will fix your mysql permissions.

在我的 CentOS 机器上,自己的和组是mysql,安装在这里。这将修复您的 mysql 权限。

chown -R mysql:mysql /var/lib/mysql

chown -R mysql:mysql /var/lib/mysql

However, chown -R root /is no doubt going to have caused you a few more problems than simply MySQL.

但是,chown -R root /无疑会给您带来比简单的 MySQL 更多的问题。