-3

有一个mysql数据库存储在我的服务器IP:50.62.82.45,数据库名称是:detail_admin,用户ID是:welcome,密码是:你好,那么我将使用什么连接字符串访问服务器数据库并触发查询mysql的

我已经尝试过了,但它不起作用

server = "50.62.82.45";
            database = "detail_admin";
            uid = "welcome";
            password = "hello";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            connection = new MySqlConnection(connectionString);

(mysql-connector-net-6.0.7-src.zip) 这个驱动我用于连接

4

1 回答 1

0
string myConnectionString = "SERVER=50.62.82.38;" +
                            "DATABASE=admin_urja;" +
                            "UID=welcome" +
                            "PASSWORD=hello;";
MySqlConnection connection = new MySqlConnection(myConnectionString);
于 2013-03-04T12:23:04.047 回答