Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Remote access of mysql through a network

  • 27-06-2007 3:52pm
    #1
    Registered Users Posts: 10,229 ✭✭✭✭


    I have a c# program which accesses a database (the db is on my local machine) What I want to be able to do is to sit the C# code in a server, so that all PC's (only 5 others) connected to that server can access program. While I can do that, I have problems running my code on a different machine, because the database is only created on the first machine...


    In my original code i had the following as the connection string for the db:
    MyConString = "SERVER=localhost;" + "DATABASE=myDB;" + "UID=****;" + "PASSWORD=****;";
    

    So I changed this so that it read:
    MyConString = "SERVER=000.000.000.000;" + "DATABASE=myDB;" + "UID=****;" + "PASSWORD=****;";
    
    where 000.000.000.000 is the static ip address of the machine i'm sitting on...

    Now whenever i try to run my code I get the following (runtime) error:
    Unable to connect to any of the specified MySQL hosts.

    Any ideas whats causing this?

    (by the way, i get this error on every machine - including the one with the db on it)


Comments

  • Moderators, Technology & Internet Moderators Posts: 37,485 Mod ✭✭✭✭Khannie


    Can you connect to the box using the mysql client?

    edit: and what OS is the mysql db running on?


  • Closed Accounts Posts: 9,608 ✭✭✭Spud83


    Make sure the Service is running under the Control Panel -> Admin -> Service.

    Make sure a firewall is not blocking the connection

    Make MySql is set up to allow remote connections


  • Registered Users Posts: 10,229 ✭✭✭✭dulpit


    Make sure the Service is running under the Control Panel -> Admin -> Service.

    Done

    Make sure a firewall is not blocking the connection

    Done (well i turned off the firewall briefly to check)

    Make MySql is set up to allow remote connections
    Done

    Still no joy...


  • Registered Users Posts: 10,229 ✭✭✭✭dulpit


    Khannie wrote:
    Can you connect to the box using the mysql client?

    edit: and what OS is the mysql db running on?

    What do you mean can i connect to the box?

    and the db is on a vista machine, but all the other pcs here are xp


  • Closed Accounts Posts: 9,608 ✭✭✭Spud83


    try using the hostname/computer name rather than the ip address?


  • Advertisement
  • Registered Users Posts: 10,229 ✭✭✭✭dulpit


    try using the hostname/computer name rather than the ip address?

    Sorry, but could you explain that? You say change the ip address in the connection string to the hostname, how does one find that?


  • Closed Accounts Posts: 9,608 ✭✭✭Spud83


    Right Click on My Computer icon on the desktop -> Properties -> Computer Name

    Dont use the computer description instead click on the "Change" button here you will see the computer name to try use.

    Edit -> Obviously for the computer that the db is on.


  • Registered Users Posts: 10,229 ✭✭✭✭dulpit


    Right Click on My Computer icon on the desktop -> Properties -> Computer Name

    Dont use the computer description instead click on the "Change" button here you will see the computer name to try use.

    Edit -> Obviously for the computer that the db is on.

    Ok it works on the local machine (using the ip address didn't) so thats a start... I'll just go check another machine there now...

    *crosses fingers*


  • Closed Accounts Posts: 9,608 ✭✭✭Spud83


    hope it works let us know


  • Moderators, Education Moderators Posts: 1,863 Mod ✭✭✭✭Slaanesh


    Also make sure the user you're logging on as has permission to login from your IP address.


  • Advertisement
  • Registered Users Posts: 10,229 ✭✭✭✭dulpit


    didn't work :( Oh well, i'll play around with it some more, but any ideas are well appreciated...


  • Closed Accounts Posts: 9,608 ✭✭✭Spud83


    Set up a shared folder on your machine and make sure you can access that from the other machines and the server. If not then you at least know its a problem in how your network is set up.


  • Closed Accounts Posts: 1,106 ✭✭✭MoominPapa


    this thread is full of people with similar woes to yourself. there are a number of suggestions such as adding pooling=true or port=3308(this seems like wishful thinking) or both to your connection string or simply updating your connector. However there doesn't seen to be a universal solution. Best of luck


Advertisement