Jump to content

Backup BD

Recommended Posts


deixo aqui mais uma pergunta... como posso fazer um backup da base de dados em MYsql através do vb, de preferência queria que o utilizador pudesse escolher a pasta do backup...


Link to post
Share on other sites

Fica aqui o codigo para para escolher a directória para onde quer guardar:


Dim saveFileDialog1 As New SaveFileDialog()
        saveFileDialog1.InitialDirectory = "Ambiente de trabalho"
        saveFileDialog1.Filter = "Ficheiros sql (*.sql)|*.sql"
        saveFileDialog1.FileName = "BackupBD"
        saveFileDialog1.FilterIndex = 2
        saveFileDialog1.RestoreDirectory = True
        If saveFileDialog1.ShowDialog = True Then
            TextBox2.Text = saveFileDialog1.FileName
        End If

e aqui o código do backup e restore...


Process.Start("C:\Program Files (x86)\EasyPHP-\mysql\bin\mysqldump.exe", "--user=root --password=password --host= --databases nomeBaseDados> -r """ & TextBox2.Text & """")

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.