Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to access a MySQL data base from a backup?

Posted on 2004-09-14
8
Medium Priority
?
271 Views
Last Modified: 2010-04-17
Hi guys,

I have a MySql data base in a server that I manage from a vb6 app.
I need to put the same data base & app. in another computer-A separately, computer-A won't access the server, ( I allready Install Mysql, MyODBC & my app. in computer-A)

I have a backup of the data base from my server that I want to use in the computer-A.

My question is:

How to put that data base (from backup) in computer-A, then I can access it from my app.?

Thank you experts.
0
Comment
Question by:ConsulmexLA
  • 3
  • 2
  • 2
  • +1
8 Comments
 

Expert Comment

by:absarahmad
ID: 12063612
if ur using mysql frontend, export the database to a textfile, copy the text file in the Computer-A and run the script in the text file, or import the text file.
In this way the whole database will be copied.
0
 
LVL 2

Expert Comment

by:Celardore
ID: 12063748
If you have access to the actual mySql directory, the database is stored as files.  In the past, I've just copied those files (and even the whole directory) to my new location.
0
 

Accepted Solution

by:
absarahmad earned 900 total points
ID: 12063851
ys this is also possible, in mysql directory there is a folder "data" in the "Data" there will be individual folder for each database.Now copy the folder "data" folder or the specific database base folder, to Computer-A mysql "data" folder.
0
Technology Partners: 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!

 
LVL 3

Expert Comment

by:Statick001
ID: 12072722
its *very* important to lock the tables before copying them, unless you are the only person using the database and you are certain there are no queries taking place.

imagine a query which updates 50 rows with a new value - if you copy the database files during this operation, then the copy will be inaccurate, and only say 25 rows will have been updated in the copy

LOCK TABLES table1 READ, table2 READ, table3 READ

this will lock the tables you specify and only allow READ access. any query which attempts to write to the database will be put on hold.

FLUSH TABLES table1, table2, table3

to ensure any unwritten (cached) data is written to disk

*now* you are ready to copy the files. as mentioned above, the files are stored in the mysql/data folder, with a folder for each database. simply copy the files to the new location

then

UNLOCK TABLES

to restore them to read/write operation


0
 

Author Comment

by:ConsulmexLA
ID: 12107647
Hi guys,
I must doing something wrong, I allready copied the database to computer-A at the following address: "C:\MySQL\Data" but nothing happens, when I open the MySQL Control Center to see the data base, I can't see anything, so when I run my app. an error message appear "Can't connect to MySQL server on localhost".
I made a little app. to change the windows registry, when I put the parameters to connect to a server, it works fine but when I put it to connect to localhost, the errror message appears, what else do I need?
0
 

Author Comment

by:ConsulmexLA
ID: 12135561
Nobody answer my question?
0
 
LVL 3

Expert Comment

by:Statick001
ID: 12140869
doesnt sound like mysql is running on that machine.
0
 

Author Comment

by:ConsulmexLA
ID: 12145059
Thank you guys,

I allready solve the problem, What I did was I opened the WinMySqlAdmin then I went to my.ini Setup and then changed the parameters #bind-address=LocalHost.

So, in that way I can see the data base that I copied.

Thank's
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Screencast - Getting to Know the Pipeline

578 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