mysql connection string over domain - mysql

i made application using VB.Net and everything is working fine on my PC at home, i wanted to start using it at my work network i installed mysql community on windows 2012 server with successful connection and that server is under domain and i logged in as admin
when i setup my application on the other machines of users i got message of unable to connect with mysql.. my understanding of this is the problem with my connection string the connection string i used is
if i try the connection string on the server machine it will work and connect
Dim conn As New MySqlConnection("server=localhost;userid=root;password=mmm123;database=dam;sslMode=none")
OR
Dim conn As New MySqlConnection("server=127.0.0.1;userid=root;password=mmm123;database=dam;sslMode=none")
but on user machine it will not it will give unable message and i even tried using ip address but still the same problem
Dim conn As New MySqlConnection("server=xx.xx.xx.xx;userid=root;password=mmm123;database=dam;sslMode=none")
can you please lead me from where i should start with
thank you in advance

Related

VB.NET MySQL Application Will Not Connect on Clients Windows 10 64-bit PC

**Hi,
I have built an application in VB.NET to connect to a MySQL database to check users registration, but here is the message that they keep getting each time that they try to run the application and check registration:
"Unable to connect to any of the specified MySQL hosts."
Here is the VB.NET code that I'm using to connect:
MysqlConn.ConnectionString = "server=198.27.87.232;userid=MyUserID;password=MyPassword;database=aaronest_ekspdb"
'AND I HAVE TRIED:
MysqlConn.ConnectionString = "Server=198.27.87.232;Port=3306;Database=aaronest_ekspdb;Uid=MyUserID;Pwd=MyPassword;"
But still, my client only see's the following message:
"Unable to connect to any of the specified MySQL hosts."
The software will connect and run great on most of my clients computers, but for some reason, every now and then, some clients receive the message above.
I have also tried to unblock my clients ports on her Windows 10 firewall to no avail.
Would appreciate the support.**
Do the same clients consistently fail, or does a client that once connected successfully experience a failure?
Consider adding Connect Timeout=60 to your connection string to increase the connection timeout from the default of 15 seconds.

Cannot connect to mysql database in Excel 2016 VBA

I'm trying to write a straightforward piece of code to connect to a MySQL database.
Sub DBConnection()
Dim conn As New ADODB.Connection
Dim connectionStr As String
connectionStr = "DRIVER={SQL SERVER} ;SERVER=localhost; database=sakila; uid=test1; pwd=123"
conn.Open connectionStr
conn.Close
MsgBox "Connected!"
End Sub
I am faced with this error when I run it:
I suspect the details I am providing in the connection may be incorrect but I'm not sure.
User and database name in the MySQL workbench:
Perhaps it's the server name but as I understand it being on my local machine it should be localhost.
Would appreciate any help on this, thanks!
I have the following MYSQL products installed
I have installed the 5.2 driver and followed the connection string for 5.2 from the website provided. The error is still persisting (see below). I'll keep googling but any help would be appreciated as I am very new to this.
My first stop for connection strings is connectionstrings.com, where you should e able to find a connection string that fits your MySQL version and your connection method.
The standard MySQL connection string is:
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
...and several others on the site for various situations.

How to attach mysql database when creating a setup?

I am using vb.net and xampp for creating my project. I want to attach the database on my setup file so that i wont have to install xampp on other computer just to make it work. Do i have to install database server?
Do i have to install database server?
Only on the machine where MySQL will run, not on every machine that runs your vb.net application. Shared data residing in a shared MySQL database is the point of using database technology.
You will need to provide a connection string to every user or every machine that runs your vb.net application. That connection string must specify these items of information
the hostname or ip address of the machine running MySQL
the name of the database on MySQL used for your application
the username of the user account on MySQL with access to the database
the password for the user account.
Your connection string will look something like this:
Server=MySQLHost;Database=myDataBase;Uid=username;Pwd=password;
For example, if your server is on 192.168.1.220, the database name is saldieApp, the MySQL username is ourMySQL, and the shared password is dontTellMom, your connection string is
Server=192.168.1.220;Database=saldieApp;Uid=ourMySQL;Pwd=dontTellMom;
Your vb.net program will do something like this to connect to MySQL.
Dim conn as MySQLConnection
conn = New MySqlConnection()
conn.ConnectionString = "Server=MySQLHost;Database=myDataBase;Uid=username;Pwd=password;"
conn.Open()
The trick for installing a company-wide application using a shared database is to distribute the appropriate connection string to each user. You can put that connection string in your setup file. Or you can do something more secure that doesn't require you to store the password in your setup file.

Emulator failing to connect to SQL Server

I am very new to programming. My company gave me some code for debugging. I am testing a Pocket PC application. No matter what ever I do I can't connect to SQL Server.
First I got the error the server doesn't exist. Second time I have error like server not accessible. I wrote simple code in device application in VS 2008 in vb.net.
The same code runs fine in a Windows forms (I am able to connect to database and pull data). But it fails in device application. I have the following code:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim row As Integer
'Dim str As String
con = New SqlConnection("Server=w****b;Database=p***5;User Id=d****;Password=*****;")
con.Open()
cmd = New SqlCommand("select * from emp", con)
row = cmd.ExecuteNonQuery()
If row > 0 Then
MessageBox.Show("the row inserted" & row)
End If
con.Close()
End Sub
I configured the emulator network property as
Enable NE2000 PCMCIA network adapter and bind to
connected network card.
After this I am getting a new error
SQL Server requires Encryption On
I checked the server and encryption is already enabled.
Does anybody know how to connect to SQL Server using emulator? It is high priority job and I am stuck because I can't do anything unless I am able to connect to a database. Any help would be appreciated.
AFAIK the NE2000 emulated networc card is not available since Windows XP. When I need a network connected Emulated Windows Mobile image, I 'dock' the running emultaed mobile device using the Device Emulator Manager (part of standalone device emulator package). Then with WMDC (ActiveSync) active on the development PC and Connection:DMA enabled, the emulated evice get's connected to the PC's network.
On the SQL Server TCP/IP Transport must be enabled. In the connection string use the IP-address of the sql server.
I did not see the "connection must be encrypted" error with standard setups.
You should also look at the SQL Server's event log for the connection error.
BTW: you can run the Windows Mobile compiled exe also on PC as long as the code does not use Mobile-only API functions.

Unable to connect to any of the specified mysql hosts VB.NET MySQL

I need to develop Client/Server Application in VB.Net, Database is MySQL.
So, Now I am doing connection testing. I created Connection string and it connected successfully in Server. Its working perfect. My Connection string is
Dim myConnectionString As String =
"SERVER=192.168.2.193;PORT=3306;UID=root;PASSWORD=globe;DATABASE=firstdb;"
But When I am trying to access from Client, it shows error : Unable to connect to any of the specified MySQL hosts.
Please help me to clear this issue.
Thanks.