Solved

How to access a MySQL data base from a backup?

Posted on 2004-09-14
8
205 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 450 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now