The Wegner flow equation is a differential equation for a family of Hamiltonians and can be considered as a continuous unitary transformation. In essence, the transformation continuously decouples degrees of freedom and gradually converts the transformed Hamiltonian into the near-diagonal form. The Wegner flow equation has so far been applied to many areas of physics, but mainly in perturbative calculations. However, the exact solutions are known only for the simplest of two-dimensional case and this certainly limits the practical application of the method. On the other hand, the knowledge of exact solutions is essential for many physical problems as well as it can help in constructing improved approximated approaches. In this paper we present the exact solution of the Wegner flow equation with the Mielke generator for 3 × 3 Hermitian matrices, the general solutions for N × N tridiagonal Hermitian matrices and partially for 4 × 4 real symmetric matrices.