Solved

Import mysql database without a dump file

Posted on 2011-02-15
9
558 Views
Last Modified: 2012-05-11
We have an old web server that was decommissioned and has been gathering dust. It had a mysql database on it which we now want access to. The server will not run but I have the entire mysql directory.

I installed mysql on a test server and would like to import the database but I don't know how. How would I go about doing that. I've imported from dump files before but I don't know how to do it with the raw files.
0
Comment
Question by:AJNS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 

Expert Comment

by:coolbloke1324
ID: 34898551
You should be able to copy the data directory from one server to another and then start the new server and the files will simply be read. Does this work for you?
0
 

Author Comment

by:AJNS
ID: 34898562
I tried that but it gave me errors that files couldn't be found. I checked the .ini file it was calling and it points to a file structure from the old server.

I tired to recreate it but it always gave me the error. That's why I was hoping there was some way to import.
0
 

Accepted Solution

by:
coolbloke1324 earned 125 total points
ID: 34898641
You shouldn't copy the ini file, only the files in the data directory.

The INI file should be located one level below the data directory.

I'd clean install a new MySQL, see where it's data directory is and then only copy your old data directory to the new one, not including any ini files, bin files etc. Only the data directory.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AJNS
ID: 34898674
ok, i'll try that right now.
0
 
LVL 8

Expert Comment

by:wolfgang_93
ID: 34898970
I would also run the mysql_update utility against it to update the tables to the
proper structure associated with the new MySQL.
0
 

Expert Comment

by:coolbloke1324
ID: 34899164
I think wolfgang_93 has an excellent point... worth doing that too. Did those steps work for you?
0
 

Author Comment

by:AJNS
ID: 34900284
I did the above and the sql service started. I am using SQL Manager 2010 to access it and I can bring up one of the databases but not the others.

In my data directory there are several folders, one called test and several others that I need, each one being a database. When I register the databases in SQL Manager it only finds the "test" database, not the others. I'm not sure what I need to do to access them.

I can type the alias in for the database and it creates a shortcut but there is not data there, it's not actually seeing it.
0
 
LVL 8

Assisted Solution

by:wolfgang_93
wolfgang_93 earned 125 total points
ID: 34901016
One thing I should have also suggested is to issue this command:
   flush tables;

I'm not familiar with SQL Manager 2010 as I use the "mysql" utility itself on the
server to do database mangement.

I found an item about SQL Manager 2010 having an option to "register" a
database -- which may be what you need to do. Here is info on it:
----
Registering Databases

In order to register a single database in SQL Manager 2010 for MySQL:

    * select the Database | Register Database... main menu item or use the corresponding Register Database btnRegisterDB toolbar button

or

    * right-click any database alias and select the Register Database... context menu item in the DB Explorer tree;
    * set all the necessary options using Register Database wizard which guides you through the entire process of database registration.

0
 

Author Comment

by:AJNS
ID: 34907464
wolfgang 93 - I was using the register database but it wasn't working. It wouldn't find the databases so after reading your post I looked up using the mysql utility and easily used it at the command line to import the databases. I was then able to register and use them in sql manager.

coolbloke1324 - your suggestion for copying just the data folder was right on the mark.

Thanks for the help
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question