我是 MySQL 新手,我正在设置用于 C# 应用程序的数据库连接。我正在关注有关设置此连接的 youtube 教程,但我对什么是服务器名称感到困惑?它只是 IP 地址还是我必须包括提供服务器的公司域名。以下是正确的吗?
private void Initialize()
{
server = "xxx.1x4.xxx.15x";
database = "nameOfDatabase";
uid = "username123";
password = "pass123";
string connectionString;
connectionString = "SERVER=" + server + ";" + "DATABASE=" +
database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
connection = new MySqlConnection(connectionString);
}