从物理文件恢复 mysql 数据库还需要哪些额外步骤?

发布于 2024-08-02 09:23:31 字数 440 浏览 2 评论 0原文

参考这个问题:

从物理文件恢复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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

汐鸠 2024-08-09 09:23:31

当我过去完成此操作时,除了您所说的之外,我唯一需要做的事情是:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文