Results 1 to 5 of 5

Thread: copy database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471

    copy database

    How can I call mysqldump or mysqlhotcopy from vb.net code? thanks.

  2. #2
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    VB Code:
    1. Module Module1
    2.  
    3.    Sub Main()
    4.       Try
    5.          Dim p As New Process()
    6.          p.StartInfo.FileName = "mysqldump"
    7.          p.StartInfo.WorkingDirectory = "d:\mysql\bin"
    8.          p.StartInfo.Arguments = "--user=root personnel"
    9.          p.Start()
    10.       Catch ex As Exception
    11.          Console.WriteLine(ex.Message)
    12.       End Try
    13.    End Sub
    14.  
    15. End Module
    like this? if not, sorry...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471
    thank you. that is something i am looking for. Could you give me sample code to pass argument to musqldump, what I want to do is pass a selected db and dump it to a new file, something like mysqldump(from, to).

  4. #4
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    to tell you the truth, i don't know much about mysql. i just use the process object since you want to run a process from mysql directory. i'm so sorry...

    all i can suggest is for you to know the arguments you need and put it in the .arguments of your process. again, sorry...

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471
    don't be sorry. At least I learned a little about the Process object from you. Thank.

Posting Permissions

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



Click Here to Expand Forum to Full Width