首页 > 解决方案 > 如何解决 VB.net 中的此类错误?MySql.Data.MySqlClient.MySqlException: '你的 Sql 语法有错误;看说明书……”

问题描述

Private connection As New MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=hotelmanagementdb")

    ReadOnly Property getConnection() As MySqlConnection
        Get
            Return connection
        End Get
    End Property

    Sub openConnection()
        If connection.State = ConnectionState.Closed Then
            connection.Open()
        End If
    End Sub

    Sub closeConnection()
        If connection.State = ConnectionState.Open Then
            connection.Close()
        End If
    End Sub

adapter.Fill(table) 处
的错误引发错误以检查与您的 MariaDB 服务器版本相对应的手册,以便password在第 1 行的“=”附近使用正确的语法
我一直在 Xampp 中更新我的 MySql 端口,原因是错误,我想这就是发生一些错误的原因

标签: mysqlvb.netphpmyadmin

解决方案


关于mysql密码,请不要输入密码。

如果你的mysql没有密码请设置, Password='';


推荐阅读