The MASSIV (Mass Assembly Survey with SINFONI in VVDS) project aims at finding constraints on the different processes involved in galaxy evolution. This study proposes to improve the understanding of the galaxy mass assembly through chemical evolution using the metallicity as a tracer of the star formation and interaction history. Methods. We analyse the full sample of MASSIV galaxies for which a metallicity estimate has been possible, that is 48 star-forming galaxies at $z\sim 0.9-1.8$, and compute the integrated values of some fundamental parameters, such as the stellar mass, the metallicity and the star formation rate (SFR). The sample of star-forming galaxies at similar redshift from zCOSMOS (P\'erez-Montero et al. 2013) is also combined with the MASSIV sample. We study the cosmic evolution of the mass-metallicty relation (MZR) together with the effect of close environment and galaxy kinematics on this relation. We then focus on the so-called fundamental metallicity relation (FMR) proposed by Mannucci et al. (2010) and other relations between stellar mass, SFR and metallicity as studied by Lara-L\'opez et al. (2010). We investigate if these relations are really fundamental, i.e. if they do not evolve with redshift. Results. The MASSIV galaxies follow the expected mass-metallicity relation for their median redshift. We find however a significant difference between isolated and interacting galaxies as found for local galaxies: interacting galaxies tend to have a lower metallicity. The study of the relation between stellar mass, SFR and metallicity gives such large scattering for our sample, even combined with zCOSMOS, that it is diffcult to confirm or deny the existence of a fundamental relation.