Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Remote PC MySql Connect to My PC

Remote PC MySql Connect to My PC

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasemysql
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    D Manivelan
    wrote on last edited by
    #1

    Hi, Am developing MFC application and using MySql database. In my pc mysql database connection properly established. it is working fine below see that code.

    mysql_init (&dbSql);

    if (! mysql\_real\_connect ( &dbSql, "sim33", "root", "root", "dbperfscore", 3306, NULL, 0))
    {         
        AfxMessageBox ("Database connection failed");    
    	printf( "Connecion establish to another PC: Error: %s\\n",mysql\_error(&dbSql));
    }
    

    but my problem is, i can't connect another PC(remote pc) that time it shows "Database connection failed" error. Please solve this issue ASAP. please help me.

    L D 2 Replies Last reply
    0
    • D D Manivelan

      Hi, Am developing MFC application and using MySql database. In my pc mysql database connection properly established. it is working fine below see that code.

      mysql_init (&dbSql);

      if (! mysql\_real\_connect ( &dbSql, "sim33", "root", "root", "dbperfscore", 3306, NULL, 0))
      {         
          AfxMessageBox ("Database connection failed");    
      	printf( "Connecion establish to another PC: Error: %s\\n",mysql\_error(&dbSql));
      }
      

      but my problem is, i can't connect another PC(remote pc) that time it shows "Database connection failed" error. Please solve this issue ASAP. please help me.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Does the other PC have network access to the server?

      1 Reply Last reply
      0
      • D D Manivelan

        Hi, Am developing MFC application and using MySql database. In my pc mysql database connection properly established. it is working fine below see that code.

        mysql_init (&dbSql);

        if (! mysql\_real\_connect ( &dbSql, "sim33", "root", "root", "dbperfscore", 3306, NULL, 0))
        {         
            AfxMessageBox ("Database connection failed");    
        	printf( "Connecion establish to another PC: Error: %s\\n",mysql\_error(&dbSql));
        }
        

        but my problem is, i can't connect another PC(remote pc) that time it shows "Database connection failed" error. Please solve this issue ASAP. please help me.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        D.Manivelan wrote:

        but my problem is, i can't connect another PC(remote pc) that time it shows "Database connection failed" error.

        And the error is?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        D 1 Reply Last reply
        0
        • D David Crow

          D.Manivelan wrote:

          but my problem is, i can't connect another PC(remote pc) that time it shows "Database connection failed" error.

          And the error is?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          D Offline
          D Offline
          D Manivelan
          wrote on last edited by
          #4

          Yes that PC also in the network. I can connect via run mode.

          L 1 Reply Last reply
          0
          • D D Manivelan

            Yes that PC also in the network. I can connect via run mode.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            What does that mean? Please collect some proper technical detail about your issue. Show us the code, and the connection details, and any error messages.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups