| | |
Connecting to a Remote Database(mySQL) on LAN
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 94
Reputation:
Solved Threads: 6
I have connected VB.net and mySQL on a the same PC before, but I have no Idea how to connect VB.net to a remote PC(LAN)
I've only changed the server
This is my code. I removed some of the details, but it works on server=localhost
I have turned off firewalls from both sides, and it keeps returning "Connection Failed"
I've only changed the server
This is my code. I removed some of the details, but it works on server=localhost
conn = New MySqlConnection()
conn.ConnectionString = "server=192.168.1.4;" & _
"user id=root;" & _
"password=;" & _
"database=system"
Try
conn.Open()
MsgBox("You have control")
conn.Close()
Catch ex As Exception
MsgBox("Connection Failed")
End TryI have turned off firewalls from both sides, and it keeps returning "Connection Failed"
•
•
Join Date: Aug 2009
Posts: 94
Reputation:
Solved Threads: 6
It works when this is connecting with mySQL on the same computer. But not on other computers in the same network(lan)
The program hangs for at least 30 secs then continues with the line: MsgBox("Connection Failed")
The program hangs for at least 30 secs then continues with the line: MsgBox("Connection Failed")
VB.NET Syntax (Toggle Plain Text)
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Last edited by yorro; Aug 29th, 2009 at 11:51 pm.
•
•
Join Date: Aug 2009
Posts: 94
Reputation:
Solved Threads: 6
•
•
•
•
well i doubt you have the permission to connect an "extern" database server as root with no password given. did u create a user account on the remote mysql server? then you should use that account. as far as i know form linux u arent allowed to connect with the root account from outside.
The program hangs for at least 30 secs then continues with the line: MsgBox("Connection Failed")
VB.NET Syntax (Toggle Plain Text)
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
I've replaced MsgBox("Connection Failed") with this
VB.NET Syntax (Toggle Plain Text)
Select Case Err.Number Case 1041 : MsgBox("Error: Server error") Case 1044 : MsgBox("Error: DB Error") Case 1045 : MsgBox("Error: Access denied") Case 1049 : MsgBox("Error: DB Error - Check the DB Name") Case Else MsgBox("Error: " & Err.Number) End Select
I receive this display "Error: 5"
Last edited by yorro; Aug 29th, 2009 at 11:54 pm.
•
•
Join Date: Aug 2009
Posts: 94
Reputation:
Solved Threads: 6
I'll just create another mySQL account and use that?
![]() |
Similar Threads
- Connecting A Website To a DataBase (Database Design)
- how to create new database in mysql (MySQL)
- Connecting to a remote MySQL Database in VB.NET (MySQL)
- Connecting to a remote MySQL Database (VB.NET)
- How to convert MS Access database to MySQL? (Visual Basic 4 / 5 / 6)
- Updating table in a remote database (ASP)
- Connecting A Website To a DataBase (MySQL)
- how to update database using mysql and jsp (JSP)
- shortcut on client to connect to remote database filemaker (MS Access and FileMaker Pro)
- timer for consolidated database (MySQL) (Visual Basic 4 / 5 / 6)
Other Threads in the VB.NET Forum
- Previous Thread: sql server does not allow to remote connection.
- Next Thread: Changing/Switching to Forms Without Seeing the Desktop
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf







