SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    restore mysql database in vb .net

    i currently has an backup of a database (called ybam) in a sql script (called c:\20053131028.sql)...
    now i want to create a button where an user can restore the ybam database by click on restore button on the vb .net form....
    what should i code in the button.... thank you very much....

  2. #2
    SitePoint Addict phpster's Avatar
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That depends on the access you have to the server. If you are looking to use code to restore the back up, you'll need to:
    1. truncate the old db (remove all tables ) Perhaps a drop and recreate the db
    2. warn the users that any and all data currently in the db and not included in the restore will be lost and 'do they want to do this?'
    3. then open the sql file and start grabbing data and passing it to mysql

    if you have the ability to send the file to the db server, you can use load infile to run the sql file against the db after dropping and recreating the db
    phpster

    I wish my computer would do what I want it to.
    Not what I tell it to do...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •