• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 569
  • Last Modified:

Import mysql database without a dump file

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
AJNS
Asked:
AJNS
  • 4
  • 3
  • 2
2 Solutions
 
coolbloke1324Commented:
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
 
AJNSAuthor Commented:
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
 
coolbloke1324Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AJNSAuthor Commented:
ok, i'll try that right now.
0
 
wolfgang_93Commented:
I would also run the mysql_update utility against it to update the tables to the
proper structure associated with the new MySQL.
0
 
coolbloke1324Commented:
I think wolfgang_93 has an excellent point... worth doing that too. Did those steps work for you?
0
 
AJNSAuthor Commented:
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
 
wolfgang_93Commented:
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
 
AJNSAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now