Community structure is one of the most significant features of complex networks and community detection is a crucial method to analyze community structure. Existing representations in community detection are inflexible and easily generate invalid solutions. To address the drawbacks, this paper proposed a multi-objective evolutionary algorithm based on mixed encoding (MOGAME). The algorithm combines the locus-based representation and labels-based representation, which can avoid generating invalid solution and improve the performance. Extensive experiments on both synthetic and real-word networks show that the proposed algorithm performs better than the existing algorithms with respect to accuracy and stability.