如何更改 MySQL 用于创建数据库目录和文件的权限?
我的 OS X Snow Leopard 机器上运行着一个自行安装的 MySQL 服务,该服务是使用 mysql.com 的自动安装程序编译的。
我遇到的问题是我想使用 Dropbox 从“data”目录同步我的数据库文件。在该文件夹中创建的所有目录和文件都被分配给用户“_mysql”和组“wheel”,权限为 700。此权限使文件有效锁定,并带有红色“禁止进入”图标覆盖,而不是允许 Dropbox 或我访问它们。
作为临时措施,我可以手动将文件权限更改为 755,以获得所需的访问权限。但是,MySQL 创建的任何新数据库文件仍将被赋予默认权限值 700。这并不理想。
我需要做的是更改 MySQL 用于创建这些文件的用户/组,或者将默认权限值更改为允许其他用户/组至少读取数据库文件的值。
I have a self-installed MySQL service running on my OS X Snow Leopard machine, compiled using the automated installer from mysql.com.
The problem I'm having is that I want to sync my database files, from the "data" directory, using Dropbox. All directories and files created within that folder are being assigned to the user "_mysql" and group "wheel", with the permission of 700. This permission is leaving the files effectively locked, with a red "no entry" icon overlay, and not allowing Dropbox, or me, access to them.
As a temporary measure I can manually change the file permissions to 755 to give me the required access. However, any new database files created by MySQL will still be given the default permission value of 700. Not ideal.
What I need to do is either change the user/group that MySQL uses to creates these files or change the default permissions value to something that will allow other users/groups to at least read the database files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一些研究,我发现您可以使用配置文件中的一个简单但相对未知的选项来更改 MySQL 运行的用户。
http://dev.mysql.com/doc/ refman/5.0/en/changing-mysql-user.html
After some research I found that you can change the user MySQL runs as with a simple, yet relatively unknown, option in the configuration file.
http://dev.mysql.com/doc/refman/5.0/en/changing-mysql-user.html