[HELP]用户'root'访问被拒绝@ localhost(使用密码:是)MySql [英] [HELP] Access denied for user 'root'@localhost (Using Password: YES) MySql

查看:109
本文介绍了[HELP]用户'root'访问被拒绝@ localhost(使用密码:是)MySql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计..

我想在我的网站上联系我的MySql

i want to connect on my MySql in my website online

但我有错误信息..

我的代码:

 Public Class Form1
    Dim MYSQLC As New MySqlConnection
    Dim MSQLDA As New MySqlDataAdapter
    Dim DTABLE As New DataTable
    Dim BSOURC As New BindingSource

#Region "Database Information"
    Dim server As String = "localhost"
    Dim userid As String = "root"
    Dim password As String = "123456789"
    Dim database As String = "sqldb"
#End Region

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
            DTABLE.Rows.Clear()
            MYSQLC.ConnectionString = "server=" & server & ";" & "user id=" & userid & ";" & "password=" & password & ";" & "database=" & database
            Dim query As String
            query = "SELECT * FROM sqldb.info ORDER BY id"
            Dim SqlCommand As New MySqlCommand(query, MYSQLC)
            MSQLDA.SelectCommand = SqlCommand
            MSQLDA.Fill(DTABLE)
            BSOURC.DataSource = DTABLE
            DataGridView1.DataSource = BSOURC
            MSQLDA.Update(DTABLE)
            MYSQLC.Close()
        Catch myerror As MySqlException
            MessageBox.Show(myerror.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Finally
            MYSQLC.Dispose()
        End Try
End Sub
End Class

顺便说一下,这个代码在appserv localhost中100%工作,但是当我需要在我的网站上连接时不能在线工作

by the way this codes work 100% in appserv localhost but not work online when i need connect on my website on internet

请帮帮我

推荐答案

如果您正在使用托管提供商,那么您可能应该向提供商咨询有关正确设置连接的信息。通常,提供商有一个控制面板来设置访问不同级别数据的权限,而默认是拒绝
访问数据库。
If you are using a hosted provider then perhaps you should inquire with the provider about properly setting up the connection. Usually providers have a control panel to setup permissions to access data at different levels while the default is to refuse access to the database.


这篇关于[HELP]用户'root'访问被拒绝@ localhost(使用密码:是)MySql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆