Solved

Import mysql database without a dump file

Posted on 2011-02-15
9
554 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
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
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…

776 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