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 there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Remote access of mysql through a network

  • 27-06-2007 2:52pm
    #1
    Registered Users, Registered Users 2 Posts: 12,379 ✭✭✭✭


    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

  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭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, Registered Users 2 Posts: 12,379 ✭✭✭✭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, Registered Users 2 Posts: 12,379 ✭✭✭✭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, Registered Users 2 Posts: 12,379 ✭✭✭✭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, Registered Users 2 Posts: 12,379 ✭✭✭✭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, Registered Users 2 Posts: 12,379 ✭✭✭✭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