When connecting to the database SQL Server, Microsoft's little thing sometimes can't recognize what localhost is Dongdong, so the Data Source = Locahost connecting the database sometimes fails, so it is best to fill in the native IP address "127.0.0.1", don't Fill what Locahost or machine name. If the database is mysql or there have been similar problems under Linux, localhost is equivalent to 127.0.0.1 equivalent.