【问题标题】:How to insert data to Mysql database hosting using vb.net如何使用 vb.net 将数据插入 Mysql 数据库托管
【发布时间】:2015-12-29 07:04:27
【问题描述】:

我有一个使用 PHP 和 MySQL 数据库的网站,可以托管。我想通过使用 VB.net 的 windows 应用程序将数据上传到网站,但我无法连接到数据库。我尝试使用此代码连接到 Mysql 数据库:

    Dim conn As MySqlConnection
    conn = New MySqlConnection()
    conn.ConnectionString = "Host=www.mydomain.com; user=test; password=****; database=test;pooling=false"
    Try
        conn.Open()
    Catch myerror As MySqlException
        MsgBox("Error connecting to database! " & myerror.Message)
    End Try

这是消息错误:

“与数据库的连接出错!用户'test'@114.134.189.135'的访问被拒绝(使用密码:YES)”。

请帮我解决。

【问题讨论】:

标签: mysql database insert


【解决方案1】:
1.Verify that MySQL service is running on your target machine
2. Ensure that user 'test' having the password 'YES'<br>
2.1 Please login any MySQl UI (Eg.,SQLYog)with your username and password for confirmation
3. If not, create a new user
   CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

【讨论】:

    猜你喜欢
    • 2017-08-19
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    • 2017-01-11
    • 2018-08-06
    • 2019-11-22
    • 2012-01-31
    • 1970-01-01
    相关资源
    最近更新 更多