+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Cant connect db of 1 site from other

  1. #1
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Cant connect db of 1 site from other

    Hello people
    I was trying to connect 1 site's mysql db from other site and wasnt able to do it. Here are few combinations that i tried and failed miserably

    1. From my localhost pages, i tried to connect with Site A and Site B using their connection strings respectively.

    2. From Site A, i tried to call site B's db.

    3. From site B, i tried to call Site A's db.

    All attempts failed with following error
    [Exception: Exception of type 'System.Exception' was thrown.]
    MySql.Data.MySqlClient.NativeDriver.Open() +110

    [MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
    At line
    Code:
    Con.Open()
    
    code's working if i am using the same site's db as all 3 locations have same db structure.

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Do you use something like this for your connection string?
    Code:
    connectionString="Database=your_db;Data Source=mysql.domain.com;Port=3306;User Id=your_user_id;Password=your_password;Connect Timeout=600;" 
    If you use a full domain or IP as the Data Source, then as long as you provide a valid username and password there should be no reason why you can't connect to any db.

  3. #3
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    RR, i use this kind of connection string
    Code:
    connectionString="Server=xx.xx.xx.xx;Database=xx;User=xx;Password=xx;Port=3306;"
    
    I dont know why it doesnt connect

    Is there any setting at host's end, which can limit db access from outside the site??

  4. #4
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Can you login to the db using mysql administrator or some other db program?

  5. #5
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Quote Originally Posted by richyrich View Post
    Can you login to the db using mysql administrator or some other db program?
    Yes RR, the dbs work fine if they are being used from their respective sites, but they dont work if called from other sites.

  6. #6
    aka RF; RadioactiveFrog grae.uk will become famous soon enough grae.uk's Avatar
    Join Date
    Oct 2008
    Posts
    211
    Rep Power
    4

    I know that when I am connecting to a MySql DB on a linux server from another server I have to go into the control panel and allow the domain name or IP address to the allowed list so the DB knows it can accept connections from that remote server...don't know if you have done this..?

    G
    “There are two theories to argueing with women. Neither of them work! ” - Unknown

  7. #7
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Quote Originally Posted by grae.uk View Post
    I know that when I am connecting to a MySql DB on a linux server from another server I have to go into the control panel and allow the domain name or IP address to the allowed list so the DB knows it can accept connections from that remote server...don't know if you have done this..?

    G
    thanx RF for the info
    No i havent done this and i m not sure if the client's server is Linux or what!!

    But just now i tried calling the db from other site from php page...... and it worked........ no idea why i cant do it with .aspx page!!

    Anyway, i'll write a php page for my requirement for the time being.

  8. #8
    aka RF; RadioactiveFrog grae.uk will become famous soon enough grae.uk's Avatar
    Join Date
    Oct 2008
    Posts
    211
    Rep Power
    4

    Quote Originally Posted by micky View Post
    thanx RF for the info
    No i havent done this and i m not sure if the client's server is Linux or what!!

    But just now i tried calling the db from other site from php page...... and it worked........ no idea why i cant do it with .aspx page!!

    Anyway, i'll write a php page for my requirement for the time being.
    It's becase PHP is just so much better!! lol Glad you found some sort of solution !
    “There are two theories to argueing with women. Neither of them work! ” - Unknown

  9. #9
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Quote Originally Posted by grae.uk View Post
    It's becase PHP is just so much better!!
    not for me
    other day i couldnt connect php with SQL Server.
    in this case its just coz, php and mysql are related to each other, i think they worked

  10. #10
    aka RF; RadioactiveFrog grae.uk will become famous soon enough grae.uk's Avatar
    Join Date
    Oct 2008
    Posts
    211
    Rep Power
    4

    Quote Originally Posted by micky View Post
    not for me
    other day i couldnt connect php with SQL Server.
    in this case its just coz, php and mysql are related to each other, i think they worked
    You are probably right. I never really got into learning aspx properly and I know php pretty well. Well enough to get by anyway
    “There are two theories to argueing with women. Neither of them work! ” - Unknown

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. What tools do you use when Optimising a site?
    By grae.uk in forum Search Engine Optimization (SEO)
    Replies: 2
    Last Post: January 18th, 2012, 05:35 AM
  2. New Site Layout
    By jmurrayhead in forum Community Support, Suggestions & Feedback
    Replies: 2
    Last Post: November 1st, 2008, 05:26 PM
  3. Site Review
    By BLaaaaaaaaaarche in forum Website Reviews
    Replies: 11
    Last Post: April 22nd, 2008, 12:13 PM
  4. Site Down Time
    By jmurrayhead in forum Announcements
    Replies: 0
    Last Post: March 30th, 2008, 10:42 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO