Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1092643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:42:52+00:00 2026-05-16T23:42:52+00:00

I signed up for an account for a free web hosting. The site provides

  • 0

I signed up for an account for a free web hosting.
The site provides MySQL databases and I’m trying to access it using my windows application but I can’t connect to the server. Please consider my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace MySql
{
    public partial class Form1 : Form
    {
        BackgroundWorker bg = new BackgroundWorker();
        string MyConString = "SERVER=209.51.195.117;" + // MySQL host: sql100.0fees.net
                "DATABASE=mydb;" +                      // IP: 209.51.195.117
                "UID=myusername;" +     // not really my username
                "PASSWORD=mypassword;"; // and password

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            bg.DoWork += new DoWorkEventHandler(bg_DoWork);
            bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted);
        }

        void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            button1.Enabled = true;
        }

        void bg_DoWork(object sender, DoWorkEventArgs e)
        {
            string status = String.Empty;
            MySqlConnection connection = new MySqlConnection(MyConString);
            try
            {
                connection.Open();
                if (connection.State == ConnectionState.Open)
                    lblStatus.Text = "Connected";
                else
                    lblStatus.Text = "No connection";
            }
            catch (Exception x)
            {
                lblStatus.Text = x.Message;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            lblStatus.Text = "Connecting... please wait.";
            button1.Enabled = false;
            bg.RunWorkerAsync();
        }
    }
}

Is it possible to connect my application to an online database? Or are there errors in my code?

By the way, this the error message being produced: Unable to connect to any of the specified MySQL hosts.

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:42:53+00:00Added an answer on May 16, 2026 at 11:42 pm

    Unless you have full control over the server, you can’t expose the mysql service to the web. This restriction is imposed by (almost; there might be exceptions) all free hosters for security reasons. Unless you provide a webservice on the server to access data, you can’t access the database remotely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I signed up for an As-You-Go account with Windows Azure, and created an SQL
I've created a self-signed cert for testing encryption between my web application and the
I recently signed up for a free usage tier account on AWS and found
I have an application signed and all ready to go public. But I want
I'm not sure what I did, but a signed in user can access the
I have multiple email addresses linked to my gmail account. I am signed up
I signed up for the iPhone Developer Program (now awaiting approval) using a new
I have signed up(paid) for Google site search. They have me a url of
Where are the signed, cached flex libraries on a windows / mac / linux
I want to AdHoc test an application. My client owns an Apple account and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.