导入旧的mysql数据文件夹

发布于 2024-09-02 02:54:55 字数 170 浏览 0 评论 0原文

重新安装后,所有旧数据仍然显示在 MySQL/data 文件夹中,但实际上并未加载到数据库中。

有没有办法让 MySQL 扫描它的数据文件夹和/或重新导入以前安装的旧文件夹?

[某些数据在上次备份/导出后发生了更改 - 部分是我的错 - 所以我宁愿它识别文件夹而不是重新导入 SQL 文件。]

After a reinstall, all of the old data still shows inside the MySQL/data folder, but is not actually loaded into the database.

Is there any way to have MySQL scan it's data folder and / or reimport the old folders it has from its previous install?

[Some data was changed after the last backup / export - partially my fault - so I would rather it recognize the folders rather than reimporting the SQL files.]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

握住我的手 2024-09-09 02:54:55

如果数据位于正确的文件夹中,它将在 MySQL 中可见,否则服务器启动时会出现错误。检查 /var/log/messages 和您的 MySQL 错误日志(如您的配置中所定义)。

如果您没有收到任何错误并且看不到数据,则 my.cnf 中的数据路径可能指向其他文件夹。

If the data is in the correct folder, it will be visible in MySQL, or you will get errors when the server starts. Check /var/log/messages and your MySQL error log (as defined in your config).

If you don't get any errors and can't see the data, it's likely that the data path in my.cnf is pointing to a different folder.

养猫人 2024-09-09 02:54:55

以上都是好主意。
要从现有备份目录恢复备份,对任何现有数据库零影响:

  • 将 my.cnf / my.ini 更改为您的备份文件夹(如果您没有 OUCH - 以后再做!!!)
  • 重新启动 MySQL

服务现在正在从您的备份运行,因此对数据表进行 MySQL 转储您需要

  • 将 my.cnf / my.ini 更改为您的活动文件夹
  • 重新启动 MySQL 服务
  • 导入您转储的 MySQL

The above are good ideas.
To recover backup from an existing backup directory with zero effect on any existing database:

  • change my.cnf / my.ini to your backup folder (if you don't have OUCH - do it in the future !!!)
  • restart MySQL service

You are now running from your backup, so do a MySQL dump for data tables you need

  • change my.cnf / my.ini to your active folder
  • restart MySQL service
  • import your dumped MySQL
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文