A Wireless Fidelity, Wi-Fi, connection method, performed by a mobile terminal, comprising: acquiring network environment information of a target Access Point, AP; acquiring (102, 202) N target Wi-Fi connection records including N passwords, the N target Wi-Fi connection records corresponding to the target AP from historical Wi-Fi connection data according to the network environment information of the target AP, the historical Wi-Fi connection data comprising M Wi-Fi connection records, where M is a positive integer and N is a positive integer less than or equal to M; and accessing the target AP according to at least one password in the N target Wi-Fi connection records, wherein the network environment information comprises identifications and signal strengths of APs around the target AP, and wherein the acquiring (102, 202) N target Wi-Fi connection records corresponding to the target AP from historical Wi-Fi connection data according to the network environment information of the target AP comprises: selecting M APs of which signal strength values are higher than a preset threshold value, around the target AP, where M is a positive integer; determining Q Wi-Fi connection records from the historical Wi-Fi connection data according to a Service Set Identifier, SSID, and an encryption scheme of the target AP; and matching the identifications of the M APs with neighbor information in each of the Q target Wi-Fi connection records to obtain the N target Wi-Fi connection records, wherein the neighbor information in each of the target Wi-Fi connection records comprises the identifications of X APs in the identifications of the M APs, where X is a positive integer less than or equal to M. acquiring network environment information of a target Access Point, AP; acquiring (102, 202) N target Wi-Fi connection records including N passwords, the N target Wi-Fi connection records corresponding to the target AP from historical Wi-Fi connection data according to the network environment information of the target AP, the historical Wi-Fi connection data comprising M Wi-Fi connection records, where M is a positive integer and N is a positive integer less than or equal to M; and accessing the target AP according to at least one password in the N target Wi-Fi connection records, wherein the network environment information comprises identifications and signal strengths of APs around the target AP, and wherein the acquiring (102, 202) N target Wi-Fi connection records corresponding to the target AP from historical Wi-Fi connection data according to the network environment information of the target AP comprises: selecting M APs of which signal strength values are higher than a preset threshold value, around the target AP, where M is a positive integer; determining Q Wi-Fi connection records from the historical Wi-Fi connection data according to a Service Set Identifier, SSID, and an encryption scheme of the target AP; and matching the identifications of the M APs with neighbor information in each of the Q target Wi-Fi connection records to obtain the N target Wi-Fi connection records, wherein the neighbor information in each of the target Wi-Fi connection records comprises the identifications of X APs in the identifications of the M APs, where X is a positive integer less than or equal to M. selecting M APs of which signal strength values are higher than a preset threshold value, around the target AP, where M is a positive integer; determining Q Wi-Fi connection records from the historical Wi-Fi connection data according to a Service Set Identifier, SSID, and an encryption scheme of the target AP; and matching the identifications of the M APs with neighbor information in each of the Q target Wi-Fi connection records to obtain the N target Wi-Fi connection records, wherein the neighbor information in each of the target Wi-Fi connection records comprises the identifications of X APs in the identifications of the M APs, where X is a positive integer less than or equal to M.