Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: x10hosting MySQL remote odbc access

  1. #1
    quantum1's Avatar
    quantum1 is offline x10Hosting Member
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    x10hosting MySQL remote odbc access

    Is it possible to remote access my x10hosting MySQL database via odbc? On my cpanel I have added my remote ip to the database Remote MySQL list, but I am not sure about the x10hosting ip address to use or if this is even possible. Thank you!
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

  2. #2
    xPlozion's Avatar
    xPlozion is offline x10 Elder
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    868

    Re: x10hosting MySQL remote odbc access

    no. the server's firewalls, not cpanel, has the final say as to what information leaves and enters the servers.

    last time i heard, x10s firewalls prohibit and disable mySQL requests from entering and exiting these servers (thus only localhost works).

  3. #3
    tittat's Avatar
    tittat is offline x10 Spammer
    Join Date
    Sep 2007
    Location
    Kerala,India
    Posts
    2,479

    Re: x10hosting MySQL remote odbc access

    x10 don't allows remote mysql connection, i believe.
    PLAY ONLINE GAMES
    WWW.TMONDO.COM PlayFar Flash Games
    Former X10 Forum Senior Moderator(Retired)


  4. #4
    xav0989's Avatar
    xav0989 is offline Community Public Relation
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,468

    Re: x10hosting MySQL remote odbc access

    You can set up a script that execute and prints the content of queries

    Server A/Script A does a file_get_contents call to Server B/Script B, with the query as a get parameter ( and maybe a security token). Script B execute the query and returns the value. Script A now uses the sql records.

    Here is an example of the script. Might be a bit buggy.
    PHP Code:
    <?php
    $db_host 
    "localhost";
    $db_port "";
    $db_login "username"//edit
    $db_password "password"//edit
    $db_database "Database name"//edit
    $security_token "A random value"//edit

     /* no need to edit passed here */
    $db_host = (empty($db_port)) ? $db_host $db_host ':' $db_port;

    /* We make sure that the security token is set and right, to prevent unauthorize access */
    if (!isset($_GET['token']) || empty($_GET['token']) || $_GET['token'] !== $security_token) {
        
    /* generate a false 404 error */
        
    header("HTTP/1.0 404 Not Found"true404);
        exit();
    }
    if (!isset(
    $_GET['query']) || empty($_GET['query'])) {
        exit(
    'No query specified');
    }

    /* connect to database */
    $db mysql_connect($db_host$db_login$db_password);
    mysql_select_db($db_database$db);

    /* you need to send the query as serialized */
    $query unserialize($_GET['query']);

    $result = @mysql_query($query$db);

    /* invalid query */
    if (!$result) {
       
    $message  'Invalid query: ' mysql_error() . "\n";
       
    $message .= 'Whole query: ' $query;
       die(
    $message);
    }

    /* send the result as serialized */
    echo serialize($result);
    ?>
    Last edited by xav0989; 03-06-2009 at 01:02 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  5. #5
    quantum1's Avatar
    quantum1 is offline x10Hosting Member
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: x10hosting MySQL remote odbc access

    xav0989,

    Thank you for your code. Someone at work has shown me something like this to get remote file contents. He showed me about SOAP stuff. If I understand your code above I can set up one php that I can get to from a browser which can then do sql stuff for me and return results. Is that correct?

    Thanks, again!
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

  6. #6
    woodyl is offline x10Hosting Member
    Join Date
    Nov 2008
    Posts
    21

    Re: x10hosting MySQL remote odbc access

    Is there any chance that x10 will change the policy to allow ODBC connections through the firewall? That would be a great feature. Is there really a big security issue around allowing those connections?

  7. #7
    lair360 is offline x10 Sophmore
    Join Date
    Dec 2008
    Posts
    200

    Re: x10hosting MySQL remote odbc access

    Quote Originally Posted by woodyl View Post
    Is there any chance that x10 will change the policy to allow ODBC connections through the firewall? That would be a great feature. Is there really a big security issue around allowing those connections?
    Yes there is!

    1.] SQL injection and attacks.
    2.] data management corrupted by hackers.
    3.] Server overload.

    That is all...

  8. #8
    xav0989's Avatar
    xav0989 is offline Community Public Relation
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,468

    Re: x10hosting MySQL remote odbc access

    Quote Originally Posted by quantum1 View Post
    xav0989,

    Thank you for your code. Someone at work has shown me something like this to get remote file contents. He showed me about SOAP stuff. If I understand your code above I can set up one php that I can get to from a browser which can then do sql stuff for me and return results. Is that correct?

    Thanks, again!
    You understood correctly. As always, it would be better to have the mysql and php on the same server or server pool, but this might do...

    But remember, never disclose where you hid this script, for security reason.

    I will post a link containing the code for both the php server and php client.
    Last edited by xav0989; 03-17-2009 at 04:32 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  9. #9
    quantum1's Avatar
    quantum1 is offline x10Hosting Member
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: x10hosting MySQL remote odbc access

    Thank you! After you post the scripts I will use them at work to solve a remote database access problem we are having involving security, ports, stuff like that. Being able to simply access the database through the browser will be great. I can allow a raw sql query to be entered into a browser window and then present the results as a simple html table or something more fancy. This will be cool!
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

  10. #10
    xav0989's Avatar
    xav0989 is offline Community Public Relation
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,468

    Re: x10hosting MySQL remote odbc access

    Quote Originally Posted by quantum1 View Post
    I can allow a raw sql query to be entered into a browser window
    You should never allow somebody to enter raw sql queries. With some knowledge of sql and php, they could compromise your account.

    If you want to know, I am almost finished, just making sure everything works.

    I've done the testing of the server/client. It's now finished. I will post the link hopefully tomorrow. Do not use the code that I posted earlier, since there is a couple of problems.
    There is also some limitations. You can use all the sql functions that do not return a resultset (UPDATE, INSERT), but you can only use SELECT to return a resultset.


    OKAY GUYS! I HAVE IT!
    here's the link: http://afrosoft.co.cc/page/en/scripts
    You can download both the client and server code. The server goes on you x10 account, the client on the other account.
    Last edited by xav0989; 03-18-2009 at 09:47 PM. Reason: Link is there!
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

Page 1 of 2 12 LastLast

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 45
    Last Post: 02-09-2013, 09:45 PM
  2. MySQL Remote access?
    By HaDAk in forum Free Hosting
    Replies: 1
    Last Post: 08-19-2008, 12:05 AM
  3. Connecting to a remote MySQL server
    By nol888 in forum Free Hosting
    Replies: 5
    Last Post: 12-05-2007, 07:16 PM
  4. Access a mysql database in asp.net
    By environ1 in forum Free Hosting
    Replies: 1
    Last Post: 11-11-2007, 10:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
dedicated servers