Solved

Import mysql database without a dump file

Posted on 2011-02-15
9
551 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
  • 4
  • 3
  • 2
9 Comments
 

Expert Comment

by:coolbloke1324
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:AJNS
Comment Utility
ok, i'll try that right now.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 8

Expert Comment

by:wolfgang_93
Comment Utility
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
Comment Utility
I think wolfgang_93 has an excellent point... worth doing that too. Did those steps work for you?
0
 

Author Comment

by:AJNS
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article describes some very basic things about SQL Server filegroups.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now