-
Aug 6th, 2014, 03:11 PM
#1
Thread Starter
New Member
I'm having trouble connecting a VB app on one computer to a MySQL database on another
I've created a contact manager application in Visual Basic and I want to save the contact records to a MySQL database on another computer on the same network. Would anyone be able to provide some insight into this? I have installed MySQL Workbench along with the appropriate connectors and the .NET framework on both computers.
-
Aug 6th, 2014, 07:09 PM
#2
Frenzied Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
What connection driver are you using?
Is your connection driver installed?
Are you using IP address or hostname on your connection?
Have you check your connectionstring if correct?
Or maybe your connection object is setup but no recordset?
Or a firewall on the server is not permitting connection?
Last edited by codesearcher; Aug 6th, 2014 at 07:16 PM.
-
Aug 6th, 2014, 07:38 PM
#3
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
Originally Posted by albra
I've created a contact manager application in Visual Basic and I want to save the contact records to a MySQL database on another computer on the same network. Would anyone be able to provide some insight into this? I have installed MySQL Workbench along with the appropriate connectors and the .NET framework on both computers.
Have you previously tested the application on the local machine?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Aug 7th, 2014, 09:46 AM
#4
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
Yes, I've tested the application locally on a machine with MySQL and it worked perfectly: a connection was established and the contact records were saved to the database.
-
Aug 8th, 2014, 01:10 AM
#5
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
-
Aug 19th, 2014, 01:50 PM
#6
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
I have looked at the thread and I have applied some of the suggestions but I still can't get it to work. As I said above, the program connects with the database, as long as the database is on the same computer. However, when I try to connect to the database from a different machine in the same network, I am presented with an error saying "Unable to connect to any of the specified MySQL hosts."
-
Aug 19th, 2014, 03:00 PM
#7
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
1) What is the connection string you're using?
2) actually, before I go on with 2 & possible 3, I need to know #1 first.
-tg
-
Aug 19th, 2014, 04:15 PM
#8
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
MySQLConnection.ConnectionString =
"server=localhost;port=3306;userid=root;password=password;database=contacts"
-
Aug 19th, 2014, 04:21 PM
#9
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
Can you even access that computer where mysql is installed? Can you open its shared folders? Are they on the same workgroup? Are they on the same IP class?
-
Aug 19th, 2014, 04:42 PM
#10
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
The computers are not in a workgroup or anything similar to that at the moment, so I can't access shared folders but they are in the same IP class.
-
Aug 19th, 2014, 04:53 PM
#11
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
They should be in the same workgroup or domain and you must be able to access its Shared folders, at least that's what I also did in addition to adding per host wanting to connect to that computer which has mysql installed.
-
Aug 19th, 2014, 05:26 PM
#12
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
I have now created a workgroup between the machines. I posted my connection string earlier, you'll notice the server is "localhost" I know that this won't work for a different computer trying to connect to the database, what should I use instead?
-
Aug 19th, 2014, 07:05 PM
#13
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
The name of the computer where mysql is installed.
-
Aug 19th, 2014, 07:36 PM
#14
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
Originally Posted by albra
MySQLConnection.ConnectionString =
"server=localhost;port=3306;userid=root;password=password;database=contacts"
Well that's why... you're accessing localhost... which is the same computer you're running on (everuy computer is "localhost") ... you need to give it either the IP or computer name..
-tg
-
Aug 20th, 2014, 10:40 AM
#15
Thread Starter
New Member
Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano
Thanks for the explanation, I changed it to the computer name and now it works.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|