使用MySQL附加现有数据库 [英] Attaching an existing database with MySQL

查看:147
本文介绍了使用MySQL附加现有数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我以前从未使用过MySQL!

Disclaimer: I have never used MySQL before!

我有一个文件夹,其中包含许多我认为是MySQL数据库的.frm,.myd和.myi文件.我已经从已淘汰的服务器中提取了这些文件,供一个已经使用多年的服务器或数据库但现在希望为新企业重新使用某些数据的客户提供.

I have a folder containing a number of .frm, .myd and .myi files that I believe are a MySQL database. I have pulled these files from a defunct server for a client who has not used the server or database for some years but is now looking to resurect some of the data for a new venture.

我已经下载了最新的免费版本的MySQL和MySQL Workbench,并希望将现有数据库连接到新的安装中.如果我使用的是MS SQL Server,则相当于附加".

I have downloaded the latest free edition of MySQL, along with MySQL Workbench and am looking to connecct the existing database to the new installation; the equivalent to an "Attach" if I were using MS SQL Server.

我发现有几篇文章说,如果我只是将文件夹复制到MySQL的数据文件夹中,然后重新启动服务,数据库就会显示出来.我已经尝试过了(使用安装文件夹中的数据文件夹以及初始配置期间创建的"MySQL Datafiles"文件夹,但是当我重新启动服务时,什么都没有显示.

I have found a few articles that say if I simply copy the folder into the data folder for MySQL and restart the service the database will show up. I have tried this (using both the data folder within the installation folder and also the "MySQL Datafiles" folder created during the intial configuration but when I restart the service nothing shows up.

我应该如何附加该数据库?

How should I go about attaching this database?

推荐答案

好.我找到了答案,我将数据库添加到的文件夹是错误的. 尽管我找到了2个数据"文件夹,但在C:\ ApplicationData中却隐藏了第3个文件夹.一旦将数据文件添加到此处并重新启动MySQL服务,我就可以看到数据.

Ok. I found the answer, the folder I was adding the database to was the wrong one. Though I had found 2 "data" folders, there was a 3rd hiding in C:\ApplicationData; once I added my data files in here and restarted the MySQL service I could see the data.

这篇关于使用MySQL附加现有数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆