
Como Instalar MySqlDump
Publicado por Evangelina (3 intervenciones) el 20/01/2014 16:05:26
Hola!!! Estoy programando en Visual Studio .NET y con MySQL 5.0. Tengo que crear un Backup de mi base de datos y restaurarlo. Lo que me esta pasando es que me crea el archivo del backup pero vació. No se si es que no le estoy dando bien la ruta en donde esta mi base de datos o si me falta instalar algo mas o agregar alguna librería. Espero que me ayuden ya que necesito terminar este proyecto para rendir el final. Les dejo el codigo para que lo vean.
Ah! y otro detalle cuando ejecuto el programa para realizar el backup me salta un cartel que si quiero ejecutar el editor desconocido de mysqldump.
tengo windows 7
Gracias
Ah! y otro detalle cuando ejecuto el programa para realizar el backup me salta un cartel que si quiero ejecutar el editor desconocido de mysqldump.
tengo windows 7
Gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Imports MySql.Data.MySqlClient
Imports Microsoft.Win32
Public Class Crear_Backup
Dim ruta As String = ""
Dim proceso As New Process
Private Function crearbackup() As Boolean
Dim anda As Boolean = False
If txtDireccion.Text.Length <> 4 Then
ruta = txtDireccion.Text + "\" + txtNombreBackUp.Text + ".sql"
Else
ruta = txtDireccion.Text + txtNombreBackUp.Text + ".sql"
End If
Try
proceso.StartInfo.CreateNoWindow = True
proceso.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
proceso.StartInfo.FileName = "mysqldump.exe"
proceso.StartInfo.Arguments = " --add-drop-database -uroot --databases bdclubdeportivo > -r" & ruta '???
proceso.Start()
proceso.WaitForExit()
anda = True
ProgressBar1.Style = ProgressBarStyle.Continuous
Me.ProgressBar1.Value = 1
Catch ex As Exception
If Not proceso.HasExited Then
proceso.Kill()
If My.Computer.FileSystem.FileExists(ruta) Then
My.Computer.FileSystem.DeleteFile(ruta)
End If
End If
End Try
Return anda
End Function
Private Sub Realizar_Backup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.AxSkin1.LoadSkin("D:\Materia Trabajo Final\TRABAJO\Sistema Club Deportivo\Sistema Club Deportivo\bin\Debug\36-skins-morpheus\Skins\Winter.skn") REM(Application.StartupPath & "\36-skins-morpheus\Cooller.skn")
Me.AxSkin1.ApplyColors = True
Me.AxSkin1.ApplySkin(Me.Handle)
End Sub
Private Sub btnExaminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExaminar.Click
'selecciono el directorio en el cual guardo el backup
Dim Directorio As New FolderBrowserDialog
If Directorio.ShowDialog = Windows.Forms.DialogResult.OK Then
txtDireccion.Text = Directorio.SelectedPath
End If
End Sub
Private Sub btnCrear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCrear.Click
If txtDireccion.Text <> "" Then 'si esta seleccionado el directorio
If txtNombreBackUp.Text <> "" Then ' si se completo con el nombre del backup
If crearbackup() = True Then
Me.ProgressBar1.Value = 100
MessageBox.Show("Backup creado satisfactoriamnete", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Error al crear el Backup", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Ingrese el nombre del Backup", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
Else
MessageBox.Show("Seleccione la ruta donde se creara el Backup", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Sub
Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSalir.Click
Close()
End Sub
End Class
Valora esta pregunta


0