从物理文件恢复 mysql 数据库还需要哪些额外步骤?
参考这个问题:
我会:
1) Shut down source server
2) Grab copy of all files in $SourceServer/data/$TheCatalog
3) Create empty "TheCatalog" on target server
4) Stop target server
5) Drop copied files into $TargetServer/data/TheCatalog
6) Start target server
7) ???
8) Profit!
新数据库的权限状态是什么?与放入数据文件之前的空数据库相同吗?我只需要设置权限和修复表吗?
Referring to this question:
Restoring MySQL database from physical files
I would:
1) Shut down source server
2) Grab copy of all files in $SourceServer/data/$TheCatalog
3) Create empty "TheCatalog" on target server
4) Stop target server
5) Drop copied files into $TargetServer/data/TheCatalog
6) Start target server
7) ???
8) Profit!
What will the permission state of the new db be? The same as the empty database before dropping the data files in? Do I just need to set permissions and repair tables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我过去完成此操作时,除了您所说的之外,我唯一需要做的事情是:
a/确保在步骤 5 中文件全部由运行 mysql 的用户拥有。
b/ 创建或更改用户以拥有目标服务器上数据库所需的权限(用户信息存储在“mysql”数据库中,而不是正在复制的数据库中)。
如果我在数据库运行时复制了文件,我只需要修复表。
When I've done this in the past the only thing(s) I've needed to do in addition to what youve stated are:
a/ ensure at step 5 that the files are all owned by the user running mysql.
b/ create or alter users to have permissions as necessary on the database on the target server (user information is stored in the 'mysql' database, not in the database being copied).
I've only needed to repair tables if I've copied the files while the database was running.