copy database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

copy database

Post by gurjit »

hi all,

i want to take a snap shot of the database and put into a text file. so i can run this query in mysql anytime and copy the database structure and data.

I only want to copy part of the data in the database but the full database structure.

for example i want to copy lets say i had a table called
tbl_login(uid,u_username),
tbl_location(lid,l_name),
tbl_school(scid,sc_name,frn_lid)

well i want to make a query which creates a text file with the entire data and structure of tbl_login table. For the tbl_location i want to take one record i specify in a query and the structure of the database and for the tbl_school table all the data relating to the tbl_location and the structure.


How can i do this?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

How often do you want to do this? If it's not too often (when an automated system would be best) then phpMyAdmin can be quite handy for data backup.

Mac
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

Post by gurjit »

I have written a system which has multi users in different countries logging on to an application. At the end of a school term in a specific territory when the user changes over to the next term is the point i want this to happen. so for that territory i need to capture the data and database structure.

i will have this as part of the process when changing terms. the text file will be stored on the server as a backup and reloaded if any queries arise to last terms data.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Post Reply