How to access a MySQL data base from a backup?

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.
Who is Participating?
absarahmadConnect With a Mentor Commented:
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.
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.
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.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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



to restore them to read/write operation

ConsulmexLAAuthor Commented:
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?
ConsulmexLAAuthor Commented:
Nobody answer my question?
doesnt sound like mysql is running on that machine.
ConsulmexLAAuthor Commented:
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.

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.

All Courses

From novice to tech pro — start learning today.