Click here to Skip to main content
13,252,206 members (55,476 online)
Rate this:
Please Sign up or sign in to vote.
hi all

i want connect to online mysql database ...

i have this information :

PHPmyAdmin url like : (this is a url that i access all database
also user and pass for enter to this domain like:
User1 And Password1

database name : mygem
database user : uuu
password      : ppp

:::: NOW :::

and my host supporter say : not exists any port for access my database ...

i used from below code for connection string

string con="Server=;Database=mygem;Uid=uuu;Pwd=ppp;";

but error accured ad say : can't connect to mysql host ....

How I Create Connection String For Connect to This Database ?

please help me

thanks a lot
Posted 9-Feb-13 11:00am
Updated 3-Apr-17 4:44am
20061967 9-Feb-13 17:28pm
Hope you have the database hosted in one of the ISP and you are trying to connect from your local windows application from your PC ?

It could be some times the ISPs would not allow connectivity from out side domain and will let you to connect from only their own domain space. could this be the reason why you are getting the "not exists any port for access my database" message ?
Sergey Alexandrovich Kryukov 26-Feb-13 19:52pm
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check[^], where you have examples how to compose conn. string for MySql.
Also make sure, you are using suitable solution, how to connect to MySQL from .NET - MySQL .NET connector[^].
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

There are few options and what is your requirement to have the remote server and connect from local windows applicaiton ? this is going to slow down your system ?

Option 1: l you may have to shop around for any providers who will enable remote access

Option 2: You can have your own dedicated server with the ISP so that you can have remote connectivity and this is expensive compared to option 1 which is shared server.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

First of All you need to Download the MySQL odbc driver 3.51 driver from MySQL website if you are using MySQL. Then you need to enable Remote MySQL Access from your domain or website using your CPANEl Account...

You then use the MySQL ODBC 3.51 Driver to connect to your Remote Database using a Connection String from your VB.Net or C# Application.

Use this connection string


myServerAddress website or domains address
mydbfile is the name of the database you have created on you cpanel account that you have allowed remote access to and
myUsername and myPassword are the username and password that you will use to connect to your remote mysql Database...

For MS Access you can connect to your uploaded Access Database using an OLEDB connection .
For instance if your website is then you can use the Microsoft.Jet driver with this Connection String below; You need to Specify the password of your database if you have any...

Dim DatabaseFile as string = ????
Dim connection_builder As New OleDb.OleDbConnectionStringBuilder
connection_builder = New OleDb.OleDbConnectionStringBuilder
connection_builder.DataSource = Me.mydbfile
connection_builder.Provider = "Microsoft.Jet.OLEDB.4.0"
connection_builder.Add("Jet OLEDB:Database Password", Password)
Return New Data.OleDb.OleDbConnection(connection_builder.ConnectionString)

That's it.. In Case you still have problems let me know...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 3 Apr 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100