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?
copy database
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
Mac
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.
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.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Couple of resources to get you started:
http://www.mysql.com/doc/en/Backup.html
http://www.mysql.com/doc/en/SHOW_CREATE_TABLE.html
Mac
http://www.mysql.com/doc/en/Backup.html
http://www.mysql.com/doc/en/SHOW_CREATE_TABLE.html
Mac