Private Function StartRestore(ByVal i As Integer) As Boolean Dim kiosk_address As String = arr_sendkiosk.Item(i) Try kiosk_address = kiosk_address.Remove(0, 2) If objConn.IsNetworkAvailable(kiosk_address) Then AppendPositive("Reponse alive from " & kiosk_address & vbCrLf) End If If Not (isSchemaExist(kiosk_address)) Then CreateNewSchema(kiosk_address) Else DropExistedSchema(kiosk_address) CreateNewSchema(kiosk_address) End If Dim constring As String = "server=" & kiosk_address & ";user=myAdmin;pwd=" & udt_server.strUserPwd & ";database=" & udt_server.strDBName & ";port=3306;" AppendPositive("Start restoring database." & vbCrLf) Using conn As New MySqlConnection(constring) Using cmd As New MySqlCommand() Using mb As New MySqlBackup(cmd) cmd.Connection = conn conn.Open() Try mb.ImportFromFile(sqlpath) AppendPositive("Restore success for " & kiosk_address & vbCrLf) conn.Close() Return True Catch ex As Exception conn.Close() AppendNegative("Restore failed for " & kiosk_address & vbCrLf) AppendNegative("Exception:-" & ex.Message & vbCrLf) Return False End Try End Using End Using End Using Catch ex As Exception AppendNegative("Unable to restore data to kiosk.Ex-" & ex.Message & vbCrLf) Return False End Try End Function
CREATE USER 'myAdmin'@'%' IDENTIFIED BY 'myAdmin321'; GRANT ALL PRIVILEGES ON *.* TO 'myAdmin'@'%'; FLUSH PRIVILEGES;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)