Using the eigenfunctional method, we derive general functional expressions of the partition function and electron Green's function of the
D-dimensional Hubbard model for zero and finite temperatures, in which the sign problem of fermions is avoided. These expressions can be calculated by solving the equation of a phase field and taking the functional average over a Lagrange multiplier field, while for some special cases they can be solved exactly. Moreover, we compare our results with the exact solution of the dynamical mean-field theory in the infinite-dimension limit.