【问题标题】:Connecting a remote phpmyadmin server with c# application使用 c# 应用程序连接远程 phpmyadmin 服务器
【发布时间】:2018-07-07 17:47:47
【问题描述】:
public class DBconnect
{
    public DBconnect()
    {
        private static string connectString = "datasource = 192.168.xx.xxx:6060/localhost;username = root;password = ;database = testlogin";

        public MySqlConnection dbConnect = new MySqlConnection(connectString);

        try
        {
            dbConnect.Open();
            Console.WriteLine("Connected");
        }
        catch (Exception x)
        {
            Console.WriteLine("Error");
        }
    }
}

我不知道怎么写这个连接字符串。谁能帮帮我?

谢谢

【问题讨论】:

    标签: c# mysql string connection


    【解决方案1】:

    试试这个

    private static string connectString = "server =192.168.xx.xxx;user id  = root;password = ;database = testlogin";
    

    【讨论】:

    • 我的数据库在不同的电脑上。所以通过本地主机我只能访问我的数据库
    • 您有什么问题吗?
    • 我在哪里指定我的端口号:6060?
    猜你喜欢
    • 2012-02-20
    • 2017-03-10
    • 1970-01-01
    • 2022-06-27
    • 1970-01-01
    • 2013-03-17
    • 1970-01-01
    • 1970-01-01
    • 2013-02-12
    相关资源
    最近更新 更多