Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to access a MySQL data base from a backup?

Posted on 2004-09-14
8
Medium Priority
?
269 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
[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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Make the most of your online learning experience.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Starting up a Project

610 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