To address the challenges and exploit the opportunities that the decarbonization of the energy sector is bringing about, advanced distribution network management and operation strategies are being developed. Many of these require accurate network models to work effectively, including user phase connectivity. However, such information is often not available. This paper proposes a novel method to identify the phase connectivity of single-and three-phase distribution consumers using smart meter measurements. The method is based on state estimation and mixed-integer linear programming, and requires shorter measurement collection times compared to statistical and machine learning-based techniques, for the same level of accuracy. Consequently, the duration of measurement efforts/campaigns aimed at obtaining this type of information reduces, accelerating the system knowledge acquisition process and potentially reducing the campaigns' costs. A technique is illustrated that allows to solve large networks in acceptable time despite the considerable number of integer variables. Extensive computational results are presented for publicly available low voltage feeders.